Re: Large difference between elapsed time and run time for queries - Mailing list pgsql-performance

From Tom Lane
Subject Re: Large difference between elapsed time and run time for queries
Date
Msg-id 19604.1047326874@sss.pgh.pa.us
Whole thread Raw
In response to Large difference between elapsed time and run time for queries  ("Scott Buchan" <sbuchan@technicacorp.com>)
List pgsql-performance
"Scott Buchan" <sbuchan@technicacorp.com> writes:
> I am simulating 200 user connections each running 6 select queries on 1
> indexed table with 50,000 records. The elapsed time for the queries average
> around 2.5 seconds while if I run the query using explain analyze while the
> test is running, the run time is around 300 ms although it takes much longer
> (few seconds) to display the results.

How many rows are these queries returning?  AFAICS the differential must
be the cost of transmitting the data to the frontend, which of course
does not happen when you use explain analyze.  (I think, but am not
completely sure, that explain analyze also suppresses the CPU effort of
converting the data to text form, as would normally be done before
transmitting it.  But given that you don't see a problem at 100
connections, that's probably not where the issue lies.)

> The database is being ran on a sunfire 880 with 4 750mhz
> processors with 8 G RAM running solaris 8

We have seen some other weird performance problems on Solaris (their
standard qsort apparently is very bad, for example).  Might be that you
need to be looking at kernel behavior, not at Postgres.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Scott Buchan"
Date:
Subject: Large difference between elapsed time and run time for queries
Next
From: Kevin Brown
Date:
Subject: Re: Index / Performance issues