Re: RES: RES: select on 1milion register = 6s

От: Decibel!
Тема: Re: RES: RES: select on 1milion register = 6s
Дата: ,
Msg-id: 20070730065241.GR25704@decibel.org
(см: обсуждение, исходный текст)
Ответ на: Re: RES: select on 1milion register = 6s  (Decibel!)
Список: pgsql-performance

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

select on 1milion register = 6s  ("Bruno Rodrigues Siqueira", )
 Re: select on 1milion register = 6s  (Craig James, )
  RES: select on 1milion register = 6s  ("Bruno Rodrigues Siqueira", )
   Re: RES: select on 1milion register = 6s  (Ragnar, )
    RES: RES: select on 1milion register = 6s  ("Bruno Rodrigues Siqueira", )
    Re: RES: select on 1milion register = 6s  (Decibel!, )
     RES: RES: select on 1milion register = 6s  ("Bruno Rodrigues Siqueira", )
      Re: RES: RES: select on 1milion register = 6s  (Decibel!, )
     Re: RES: RES: select on 1milion register = 6s  (Decibel!, )
   Re: select on 1milion register = 6s  ("Scott Marlowe", )
    Re: select on 1milion register = 6s  (Alvaro Herrera, )
    Re: select on 1milion register = 6s  (Jan Dittmer, )
 Re: select on 1milion register = 6s  (Hervé Piedvache, )
  RES: select on 1milion register = 6s  ("Bruno Rodrigues Siqueira", )
  RES: select on 1milion register = 6s  ("Bruno Rodrigues Siqueira", )

Please reply-all so others can learn and contribute.

On Sun, Jul 29, 2007 at 09:38:12PM -0700, Craig James wrote:
> Decibel! wrote:
> >It's unlikely that it's going to be faster to index scan 2.3M rows than
> >to sequential scan them. Try setting enable_seqscan=false and see if it
> >is or not.
>
> Out of curiosity ... Doesn't that depend on the table?  Are all of the data
> for one row stored contiguously, or are the data stored column-wise?  If
> it's the former, and the table has hundreds of columns, or a few columns
> with large text strings, then wouldn't the time for a sequential scan
> depend not on the number of rows, but rather the total amount of data?

Yes, the time for a seqscan is mostly dependent on table size and not
the number of rows. But the number of rows plays a very large role in
the cost of an indexscan.
--
Decibel!, aka Jim C. Nasby, Database Architect  
Give your computer some brain candy! www.distributed.net Team #1828

Вложения

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

От: Richard Huxton
Дата:
Сообщение: Re: Questions on Tags table schema
От: Richard Huxton
Дата:
Сообщение: Re: Questions on Tags table schema