[postgis-users] Very slow with geometries having thousands of points

strk strk at keybit.net
Fri Jul 30 05:27:54 PDT 2004


Tuan, take a look at WKB output functions, they would speed up things.
Also consider using a binary cursor.
--strk;

On Fri, Jul 30, 2004 at 07:14:44PM +0700, Tuan Pham Anh wrote:
> 
> Hello PostGIS users,
> 
> I'm new to PostGIS and this is my first problem, and I hope you can help
> me.
> 
> I have a geo table in PostgreSQL with 8 records, but each record
> contains  some polygons with thousands of points.
> 
> So in my test application in Java, I do the following code :
> 
> 
> String _strDriver = "org.postgresql.Driver";
> String _strDatabaseURL = "jdbc:postgresql://localhost:5432/mydb";
> String _strUserName = "tuanpa";
> String _strPassword = "";
> String _strSQL = "select geom from tbl_regions";
> 
> Class.forName(_strDriver);
> Connection conn = DriverManager.getConnection(_strDatabaseURL,
> _strUserName, _strPassword);
> Statement s = conn.createStatement();
> ResultSet r = s.executeQuery(_strSQL);
> 
> while (r.next()) {
>   // Do nothing here.
> }
> 
> r.close();
> s.close();
> conn.close();
> 
> --------------
> 
> OK, it's quite simple.
> 
> So my question are:
> 
> 1. I don't know why it take too much resources. In my computer, Celeron
> 1.7, 512 MB RAM, It takes 4 seconds and 100% process.
> I use Window XP, PostgreSQL version 7.4.
> 
> 2. I have read somewhere said that PostgreSQL doesn't get good
> performance on Window box. So I love to hear how the performance is on
> Linux box.
> I have upload the scripts to create table and insert data at:
> http://www.vngeobiz.com/temp/script.zip
> 
> 
> Thanks,
> 
> ------------------------------------------
> Pham Anh Tuan
> R&D Officer
> Geobiz - GIS Technology Solutions.
> Website: http://www.vngeobiz.com/
> Email: tuanpa at vngeobiz.com
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list