#274 Change TransferDB when getting table metadata

closed
Fred Toussi
tools (21)
1
2012-02-27
2011-12-20
Scott Carlson
No

To get the table metadata, TransferDB queries the whole table . For large tables this was unusably slow.

My fix was to add a where clause that causes the metadata to return but no data gets found.

--- workspace/hsqldb/hsqldb/src/org/hsqldb/util/TransferDb.java 2011-08-17 10:58:37.537891854 -0500
+++ Downloads/hsqldb-2.2.6/hsqldb/src/org/hsqldb/util/TransferDb.java 2011-06-05 20:21:12.000000000 -0500
@@ -741,7 +741,7 @@

try {
stmt = conn.createStatement();
- select_rs = stmt.executeQuery(TTable.Stmts.sSourceSelect + " WHERE 1 = 2");
+ select_rs = stmt.executeQuery(TTable.Stmts.sSourceSelect);
select_rsmdata = select_rs.getMetaData();
col = meta.getColumns(TTable.Stmts.sDatabaseToConvert,
TTable.Stmts.sSchema,

Discussion

  • Fred Toussi
    Fred Toussi
    2012-01-17

    • assigned_to: nobody --> fredt
     
  • Fred Toussi
    Fred Toussi
    2012-01-17

    Thanks. Will apply your patch.

     
  • Fred Toussi
    Fred Toussi
    2012-02-27

    • priority: 5 --> 1
    • status: open --> closed
     
  • Fred Toussi
    Fred Toussi
    2012-02-27

    patch committed.