From: | Josh Berkus <josh(at)agliodbs(dot)com> |
---|---|
To: | Jeremiah Jahn <jeremiah(at)cs(dot)earlham(dot)edu> |
Cc: | postgres performance <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: name search query speed |
Date: | 2005-03-03 17:44:37 |
Message-ID: | 200503030944.37743.josh@agliodbs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Jeremiah,
> I have about 5M names stored on my DB. Currently the searches are very
> quick unless, they are on a very common last name ie. SMITH. The Index
> is always used, but I still hit 10-20 seconds on a SMITH or Jones
> search, and I average about 6 searches a second and max out at about
> 30/s. Any suggestions on how I could arrange things to make this search
> quicker? I have 4gb of mem on a raid 5 w/ 3 drives. I'm hoping that I
> can increase this speed w/o a HW upgrade.
First off, see http://www.powerpostgresql.com/PerfList about your
configuration settings.
The problem you're running into with SMITH is that, if your query is going to
return a substantial number of rows (variable, but generally anything over 5%
of the table and 1000 rows) is not able to make effective use of an index.
This makes it fall back on a sequential scan, and based on you execution
time, I'd guess that the table is a bit too large to fit in memory.
AFTER you've made the configuration changes above, AND run VACUUM ANALYZE on
your database, if you're still having problems post an EXPLAIN ANALYZE of the
query to this list.
--
Josh Berkus
Aglio Database Solutions
San Francisco
From | Date | Subject | |
---|---|---|---|
Next Message | John A Meinel | 2005-03-03 17:46:02 | Re: name search query speed |
Previous Message | Josh Berkus | 2005-03-03 17:35:14 | Re: Help with tuning this query (with explain analyze finally) |