X-Original-To: pgsql-performance@postgresql.org Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 5B479475FC8 for ; Mon, 10 Mar 2003 15:07:54 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h2AK7sub019605; Mon, 10 Mar 2003 15:07:55 -0500 (EST) To: "Scott Buchan" Cc: pgsql-performance@postgresql.org Subject: Re: Large difference between elapsed time and run time for queries In-reply-to: <71F044551C53974EB0735B3737EFE2FC088628@wwwserver> References: <71F044551C53974EB0735B3737EFE2FC088628@wwwserver> Comments: In-reply-to "Scott Buchan" message dated "Mon, 10 Mar 2003 13:58:26 -0500" Date: Mon, 10 Mar 2003 15:07:54 -0500 Message-ID: <19604.1047326874@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200303/73 X-Sequence-Number: 1371 "Scott Buchan" 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