Re: INDEX and JOINs

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Reg Me Please <regmeplease(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: INDEX and JOINs
Date: 2007-10-26 11:05:10
Message-ID: 20071026110510.GB24394@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Reg Me Please 2007-10-26 11:10:42 Re: INDEX and JOINs
Previous Message Sam Mason 2007-10-26 11:03:47 Re: select count() out of memory