Re: Query performance question on a large table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: csegyud(at)vnet(dot)hu
Cc: "Pgsql-General(at)Postgresql(dot)Org (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Query performance question on a large table
Date: 2004-01-06 20:03:56
Message-ID: 22951.1073419436@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?iso-8859-2?Q?Egy=FCd_Csaba?= <csegyud(at)vnet(dot)hu> writes:
> 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;

> Ohh, I nearly forgot the config: Linux 7.1; Postgres 7.3.2;

The first thing you ought to do is move to PG 7.4. "foo IN (SELECT ...)"
generally works a lot better under 7.4 than prior releases. I'd suggest
dropping the "DISTINCT" when using 7.4, too.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josh Berkus 2004-01-06 20:08:18 Re: Paypal
Previous Message Együd Csaba 2004-01-06 19:41:58 Query performance question on a large table