From: <db...@sv...> - 2005-03-29 21:16:35
|
Author: dblasby Date: 2005-03-29 13:17:16 -0800 (Tue, 29 Mar 2005) New Revision: 12843 Modified: geotools/trunk/gt/module/main/src/org/geotools/data/jdbc/fidmapper/Def= aultFIDMapperFactory.java Log: javadoc changes + performance change Modified: geotools/trunk/gt/module/main/src/org/geotools/data/jdbc/fidmap= per/DefaultFIDMapperFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- geotools/trunk/gt/module/main/src/org/geotools/data/jdbc/fidmapper/De= faultFIDMapperFactory.java 2005-03-29 21:14:00 UTC (rev 12842) +++ geotools/trunk/gt/module/main/src/org/geotools/data/jdbc/fidmapper/De= faultFIDMapperFactory.java 2005-03-29 21:17:16 UTC (rev 12843) @@ -273,7 +273,10 @@ * Returns true if the specified column is auto-increment. This meth= od is * left protected so that specific datastore implementations can put= their * own logic, should the default one be ineffective or have bad - * performance + * performance. + *=20 + * NOTE: the postgis subclass will call this with the columnname an= d table name pre-double-quoted! + * Other DB may have to do the same - please check your DB's = documentation. * * @param catalog * @param schema @@ -305,7 +308,9 @@ statement =3D conn.createStatement(); statement.setFetchSize(1); rs =3D statement.executeQuery("Select " + columnName + " fro= m " - + tableName); + + tableName+" WHERE 0=3D1"); //DJB: the "where 0=3D= 1" will optimize if you have a lot of dead tuples + // if the WHERE 0=3D1 give any data store problems, just rem= ove it=20 + // and put a comment here as to why it caused problems. =20 java.sql.ResultSetMetaData rsInfo =3D rs.getMetaData(); autoIncrement =3D rsInfo.isAutoIncrement(1); |