Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseWikiWordStoreBuilder.java |
— | — | @@ -304,7 +304,7 @@ |
305 | 305 | |
306 | 306 | protected int executeChunkedUpdate(DatabaseAccess.ChunkedQuery query, int factor) throws PersistenceException { |
307 | 307 | try { |
308 | | - int chunk = updateChunkSize / factor; |
| 308 | + int chunk = factor < 0 ? updateChunkSize * -factor : updateChunkSize / factor; |
309 | 309 | return database.executeChunkedUpdate(query, chunk, getAgenda()); |
310 | 310 | } catch (SQLException e) { |
311 | 311 | throw new PersistenceException(e); |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseWikiWordConceptStoreBuilder.java |
— | — | @@ -401,12 +401,13 @@ |
402 | 402 | |
403 | 403 | }; |
404 | 404 | |
405 | | - return executeChunkedUpdate(query, 1); |
| 405 | + return executeChunkedUpdate(query, -5); |
406 | 406 | } |
407 | 407 | |
408 | 408 | protected int buildBiLink() throws PersistenceException { |
409 | 409 | String sql = "insert ignore into "+relationTable.getSQLName()+" (concept1, concept2, bilink)" + |
410 | | - " select A.anchor, A.target, 1 from "+linkTable.getSQLName()+" as A " + |
| 410 | + " select A.anchor, A.target, 1 from "+linkTable.getSQLName()+" as A " + |
| 411 | + " force index (anchor_target) " + //NOTE: avoid table scan! |
411 | 412 | " join "+linkTable.getSQLName()+" as B on A.anchor = B.target AND B.anchor = A.target "; |
412 | 413 | String suffix = " on duplicate key update bilink = bilink + values(bilink)"; |
413 | 414 | |