We noticed that in databases with lots of tables, OGR throws some pretty crazy SQL at the database, and things get slow and the source of the problem seems to be here:
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/pg/ogrpgdatasource.cpp#L851 Which in addition to being a big query on system tables joins back to geometry_columns, which is, itself now a big query on system tables. I think that’s the main problem. Probably either the query should just use the system tables alone, and take advantage of the PostGIS geometry_columns view code as a guide http://trac.osgeo.org/postgis/browser/trunk/postgis/postgis.sql.in#L4980 The only trick is, I guess, figuring out which versions of PgSQL particular system table code will work against. The main dividing line for PostGIS is between versions 1 and 2. What’s the minimum supported version of PgSQL for OGR? P. -- http://postgis.net http://cleverelephant.ca _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev