RE : Seq scan of table?

From: "Bruno BAGUETTE" <pgsql-ml(at)baguette(dot)net>
To: "'Bjorn T Johansen'" <btj(at)havleik(dot)no>, <pgsql-general(at)postgresql(dot)org>
Subject: RE : Seq scan of table?
Date: 2003-09-05 06:34:47
Message-ID: !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAATBuXKOMvlkWzD3KJN6FWLMKAAAAQAAAAFjfXWJYWwkSSEWAGOI+R0gEAAAAA@baguette.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

Hello,

> I am trying to tune my database and I discovered one select
> that does a seq scan on a table but I can't see why... All
> the join fields are indexed and I am returning just one
> record, so no sort is done. Does it just pick seq scan for
> the heck of it or is it a reason?

Are the join fields both of the exactly same type ? If no (eg : INT2 and
INT4)
you must cast in order to have the same type.

If the join fields are not of the same type, PostgreSQL will do a seq
scan.

I had exactly the same problem and learned here that tip :-)

Hope this help,

---------------------------------------
Bruno BAGUETTE - pgsql-ml(at)baguette(dot)net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-09-05 06:37:51 Re: SQL Error: pqReadData() -- read() failed: errno=0 No error
Previous Message Bjorn T Johansen 2003-09-05 06:08:07 Seq scan of table?

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-09-05 06:44:51 Re: Seq scan of table?
Previous Message Bjorn T Johansen 2003-09-05 06:08:07 Seq scan of table?