Commit 1aca895f authored by Stefan Huehner's avatar Stefan Huehner
Browse files

ISSUE-47047: Speedup Reading tables - part2

After previous change the columnIndexes array in pg readTable is no
longer needed.
Remove it together with it's SQL _stmt_column_indexes removing one query
per readTable call.
parent 31fc2d69
......@@ -63,7 +63,6 @@ public class PostgreSqlModelLoader extends ModelLoaderBase {
protected PreparedStatement _stmt_oids_funcs;
protected PreparedStatement _stmt_comments_funcs;
protected PreparedStatement _stmt_oids_tables;
protected PreparedStatement _stmt_column_indexes;
protected Translation _checkTranslation = new PostgreSqlCheckTranslation();
protected Translation _SQLTranslation = new PostgreSQLStandarization();
......@@ -375,9 +374,6 @@ public class PostgreSqlModelLoader extends ModelLoaderBase {
_stmt_oids_tables = _connection
.prepareStatement("SELECT oid, relname FROM pg_class WHERE upper(relname) = ?");
_stmt_column_indexes = _connection.prepareStatement(
"SELECT ordinal_position FROM information_schema.columns WHERE table_name = ? order by ordinal_position;");
}
@Override
......@@ -616,8 +612,6 @@ public class PostgreSqlModelLoader extends ModelLoaderBase {
// tablename from readTable with the exact case like in the database
String tableRealName;
ArrayList<Integer> columnIndexes;
@Override
protected Table readTable(String tablename) throws SQLException {
_stmt_oids_tables.setString(1, tablename);
......@@ -631,15 +625,6 @@ public class PostgreSqlModelLoader extends ModelLoaderBase {
Table t = super.readTable(tableRealName);
columnIndexes = new ArrayList<Integer>();
_stmt_column_indexes.setString(1, tableRealName);
fillList(_stmt_column_indexes, new RowFiller() {
@Override
public void fillRow(ResultSet r) throws SQLException {
columnIndexes.add(r.getInt(1));
}
});
return t;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment