Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id CF4139FB413 for ; Fri, 12 Jan 2007 20:31:21 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 86204-03 for ; Fri, 12 Jan 2007 20:31:08 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web35309.mail.mud.yahoo.com (web35309.mail.mud.yahoo.com [66.163.179.103]) by postgresql.org (Postfix) with SMTP id EAEA59FB39A for ; Fri, 12 Jan 2007 20:31:12 -0400 (AST) Received: (qmail 49116 invoked by uid 60001); 13 Jan 2007 00:31:09 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=iUHyv1Kix0hNqglTT/YIKUyo3gt9CqNSllkDCrzx0j2hUu2mVdXqj+qPxSXLTMXrXES/DYfXtHouWT3oJNafWBFcjk2M13je8gtKMeXrlt8g6z0sOkGAEwHPq0pjvpn3OAF6nQF22R46WiUgE1zCGJEnzd9FXCWR/Mvcunrj5R0=; X-YMail-OSG: vNf2ldoVM1mg4D4fN04UYj3laoVKrYclgHR3nJf1E4UNRi846ufa77ixyKfEvDFh5kUwgBOdV2jhQR_wksWspjVqkw6pzdrWWZERGUlYbHX.8zWoclqFQF_1gee.BRMQIxAzufffi4n1GLA- Received: from [75.58.233.19] by web35309.mail.mud.yahoo.com via HTTP; Fri, 12 Jan 2007 16:31:09 PST Date: Fri, 12 Jan 2007 16:31:09 -0800 (PST) From: Mark Dobbrow Subject: Large table performance To: pgsql-performance@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1465165067-1168648269=:48483" Content-Transfer-Encoding: 8bit Message-ID: <376735.48483.qm@web35309.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.152 tagged_above=0 required=5 tests=BAYES_50, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, HTML_00_10, HTML_MESSAGE X-Spam-Level: **** X-Archive-Number: 200701/209 X-Sequence-Number: 22810 --0-1465165067-1168648269=:48483 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello - I have a fairly large table (3 million records), and am fetching 10,000 non-contigous records doing a simple select on an indexed column ie select grades from large_table where teacher_id = X This is a test database, so the number of records is always 10,000 and i have 300 different teacher ids. The problem is, sometimes fetching un-cached records takes 0.5 secs and sometimes (more often) is takes more like 10.0 seconds (fetching the same records for a given teacher_id a second time takes about 0.25 secs) Has anyone seen similar behavior or know what the solution might be? any help much appreciated, Mark ps. My shared_buffers is set at 5000 (kernal max), and work_mem=8192 --0-1465165067-1168648269=:48483 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello -

I have a fairly large table (3 million records), and am fetching 10,000 non-contigous records doing a simple select on an indexed column ie

select grades from large_table where teacher_id = X

This is a test database, so the number of records is always 10,000 and i have 300 different teacher ids.

The problem is, sometimes fetching un-cached records takes 0.5 secs and sometimes (more often) is takes more like 10.0 seconds

(fetching the same records for a given teacher_id a second time takes about 0.25 secs)

Has anyone seen similar behavior or know what the solution might be?

any help much appreciated,
Mark



ps. My shared_buffers is set at 5000 (kernal max), and work_mem=8192


--0-1465165067-1168648269=:48483--