From: | Együd Csaba <csegyud(at)vnet(dot)hu> |
---|---|
To: | "Pgsql-General(at)Postgresql(dot)Org (E-mail)" <pgsql-general(at)postgresql(dot)org> |
Subject: | Query performance question on a large table |
Date: | 2004-01-06 19:41:58 |
Message-ID: | 000701c3d48d$26adfdc0$230a0a0a@compaq |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi All,
how can I improve the query performance in the following situation:
I have a big (4.5+ million rows) table. One query takes approx. 9 sec to
finish resulting ~10000 rows. But if I run simultaneously 4 similar queries
it takes nearly 5 minutes instead of 4 times 9 seconds or something near of
that.
here is a sample query:
select mertido, fomeazon, ertektipus, mertertek from t_me30 where fomeazon
in (select distinct fomeazon from t_fome where lower(inuse) = 'igen') and
mertido like '2003-12-17%' and ertektipus in ('+MW') order by mertido,
fomeazon, ertektipus;
What kind of indexes could speed up a query like this? I tried to create one
on fields (mertido, fomeazon, ertektipus) but led me much longer execution
time.
Ohh, I nearly forgot the config: Linux 7.1; Postgres 7.3.2;
Thank you,
bye
----------------------------------------
Csaba Együd
csegyud(at)vnet(dot)hu
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2004-01-06 20:03:56 | Re: Query performance question on a large table |
Previous Message | Joshua D. Drake | 2004-01-06 19:39:45 | Re: Paypal WAS: PostgreSQL speakers needed for OSCON |