Re: INDEX and JOINs - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: INDEX and JOINs
Date
Msg-id 20071026110510.GB24394@svana.org
Whole thread Raw
In response to INDEX and JOINs  (Reg Me Please <regmeplease@gmail.com>)
Responses Re: INDEX and JOINs  (Reg Me Please <regmeplease@gmail.com>)
List pgsql-general
On Fri, Oct 26, 2007 at 12:34:06PM +0200, Reg Me Please wrote:
> it's very fast (of course!). But when I run:
>
> SELECT * FROM T_DATA NATURAL JOIN T_FIELDS WHERE TABL_ID='TABL';
>
> it's very slow.
> The EXPLAIN says that in the second case it has to do a sequential
> scan on T_DATA. And this explains the timing.
> Is there a way to avoid such a behaviour by acting on indexes?

Firstly, have you run ANALYZE recently. Secondly, you'll have to show
us the output of EXPLAIN ANALYZE if you want some useful help.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: select count() out of memory
Next
From: Sam Mason
Date:
Subject: Re: select count() out of memory