Re: [PERFORM] Seq scan of table?

От: Bjørn T Johansen
Тема: Re: [PERFORM] Seq scan of table?
Дата: ,
Msg-id: 1062768204.11199.23.camel@pennywise.havleik.no
(см: обсуждение, исходный текст)
Ответ на: Re: [PERFORM] Seq scan of table?  (Richard Huxton)
Список: pgsql-general

Скрыть дерево обсуждения

Seq scan of table?  ("Bjorn T Johansen", )
 RE : Seq scan of table?  ("Bruno BAGUETTE", )
 Re: Seq scan of table?  (Tom Lane, )
  Re: Seq scan of table?  ("Bjorn T Johansen", )
 Re: RE : Seq scan of table?  ("Bjorn T Johansen", )
 Re: Seq scan of table?  ("Bjorn T Johansen", )
  Re: [PERFORM] Seq scan of table?  (Richard Huxton, )
   Re: [PERFORM] Seq scan of table?  (Bjørn T Johansen, )
   Re: [PERFORM] Seq scan of table?  (Neil Conway, )
  Re: Seq scan of table?  (Jonathan Bartlett, )
   Re: [PERFORM] Seq scan of table?  (Ron Johnson, )
 Re: [PERFORM] Seq scan of table?  (Richard Huxton, )
 Re: [PERFORM] Seq scan of table?  (Tom Lane, )

On Fri, 2003-09-05 at 12:07, Richard Huxton wrote:
> On Friday 05 September 2003 09:47, Bjorn T Johansen wrote:
> > 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?
>
> PG's parser will assume an explicit number is an int4 - if you need an int8
> etc you'll need to cast it, yes.
> You should find plenty of discussion of why in the archives, but the short
> reason is that PG's type structure is quite flexible which means it can't
> afford to make too many assumptions.

Oki, I am using both int2 and int8 as well, so that explains it...
Thanks!


BTJ





В списке pgsql-general по дате сообщения:

От: Jeffrey Melloy
Дата:
Сообщение: Re: How can I set postmaster as a service
От: CSN
Дата:
Сообщение: Re: Pagination - 1 or 2 queries?