Re: Seq scan of table? - Mailing list pgsql-general

From Bjorn T Johansen
Subject Re: Seq scan of table?
Date
Msg-id 31414.193.212.14.12.1062751674.squirrel@www.havleik.no
Whole thread Raw
In response to Seq scan of table?  ("Bjorn T Johansen" <btj@havleik.no>)
Responses Re: [PERFORM] Seq scan of table?  (Richard Huxton <dev@archonet.com>)
Re: Seq scan of table?  (Jonathan Bartlett <johnnyb@eskimo.com>)
List pgsql-general
I think I have found out why.. I have a where clause on a ID field but it
seems like I need to cast this integer to the same integer as the field is
defined in the table, else it will do a tablescan.

Is this assumtion correct? And if it is, do I then need to change all my
sql's to cast the where clause where I just have a number (eg where field
= 1) to force the planner to use index scan instead of seq scan?


BTJ

> 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?
>
> Regards,
>
> BTJ
>
> -----------------------------------------------------------------------------------------------
> Bjørn T Johansen (BSc,MNIF)
> Executive Manager
> btj@havleik.no                  Havleik Consulting
> Phone : +47 67 54 15 17         Conradisvei 4
> Fax : +47 67 54 13 91           N-1338 Sandvika
> Cellular : +47 926 93 298       http://www.havleik.no
> -----------------------------------------------------------------------------------------------
> "The stickers on the side of the box said "Supported Platforms: Windows
> 98, Windows NT 4.0,
> Windows 2000 or better", so clearly Linux was a supported platform."
> -----------------------------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>



pgsql-general by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: Replaceing records
Next
From: psql-mail@freeuk.com
Date:
Subject: Re: postmaster crashing