Re: Query performance question on a large table - Mailing list pgsql-general

From Tom Lane
Subject Re: Query performance question on a large table
Date
Msg-id 22951.1073419436@sss.pgh.pa.us
Whole thread Raw
In response to Query performance question on a large table  (Együd Csaba <csegyud@vnet.hu>)
Responses Re: Query performance question on a large table  (Sean Shanny <shannyconsulting@earthlink.net>)
Re: Query performance question on a large table  (Együd Csaba <csegyud@vnet.hu>)
Re: Query performance question on a large table  (Együd Csaba <csegyud@vnet.hu>)
List pgsql-general
=?iso-8859-2?Q?Egy=FCd_Csaba?= <csegyud@vnet.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

pgsql-general by date:

Previous
From: Együd Csaba
Date:
Subject: Query performance question on a large table
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Postgresql & 64 Bit Opteron