Re: Large difference between elapsed time and run time for queries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Scott Buchan" <sbuchan(at)technicacorp(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Large difference between elapsed time and run time for queries
Date: 2003-03-10 20:07:54
Message-ID: 19604.1047326874@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Scott Buchan" <sbuchan(at)technicacorp(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Marc G. Fournier 2003-03-11 02:50:59 Re: pgsql-server/ /configure /configure.in rc/incl ...
Previous Message Scott Buchan 2003-03-10 18:58:26 Large difference between elapsed time and run time for queries