Tuning to speed select

From: Tom Laudeman <twl8n(at)virginia(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Tuning to speed select
Date: 2006-08-09 13:19:31
Message-ID: 44D9E0E3.6010203@virginia.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I'm running PostgreSQL version 8 on a dual 2.4GHz Xeon with 1GB of RAM
and an IDE hard drive. My big table has around 9 million records.

Is there a tuning parameter I can change to increase speed of selects?
Clearly, there's already some buffering going on since selecting an
indexed ~50,000 records takes 17 seconds on the first try, and only 0.5
seconds on the second try (from pgsql).

cowpea=> explain analyze select bs_fk from blast_result where
si_fk=11843254;
QUERY
PLAN
--------------------------------------------------------------------------------------------------------------------------------------------
Index Scan using si_fk_index on blast_result (cost=0.00..22874.87
rows=58118 width=4) (actual time=112.249..17472.935 rows=50283 loops=1)
Index Cond: (si_fk = 11843254)
Total runtime: 17642.522 ms
(3 rows)

cowpea=> explain analyze select bs_fk from blast_result where
si_fk=11843254;
QUERY
PLAN
----------------------------------------------------------------------------------------------------------------------------------------
Index Scan using si_fk_index on blast_result (cost=0.00..22874.87
rows=58118 width=4) (actual time=0.178..341.643 rows=50283 loops=1)
Index Cond: (si_fk = 11843254)
Total runtime: 505.011 ms
(3 rows)

cowpea=>

Thanks,
Tom

--
Tom Laudeman
twl8n(at)virginia(dot)edu
(434) 924-2456
http://www.people.virginia.edu/~twl8n/
http://laudeman.com/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message AgentM 2006-08-09 13:21:47 Re: psql/readline clears screen
Previous Message Martijn van Oosterhout 2006-08-09 13:12:55 Re: psql/readline clears screen