[postgis-devel] GUI Speed

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Mon Jul 12 07:45:53 PDT 2010


Paul Ramsey wrote:

> Mark,
> The main point in the profile, is that the majority of time is not
> being spent in the loader at all, it's being spent in the postgres
> process. And oddly, the gui and the cli are exercising very
> *different* parts of the postgres code.
> P.

No worries, I understand that part. My point was more that while we can 
see that the postgres process is taking more time, we cannot determine 
whether or not that is because it is waiting for lines of data (i.e. 
it's taking much longer for each line of data to reach the server).

Re-reading the API docs, it does seem that PQputCopyData() can handle 
any specific buffer size of data. So if you think PQputCopyData() is the 
bottleneck, try picking a buffer of around 64k, strncat multiple lines 
together within the main loop until the buffer is full, and then send 
everything as a massive buffer-sized chunk in one go.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs



More information about the postgis-devel mailing list