Re: Anything I can do to speed up this query?

Поиск
Список
Период
Сортировка
От Ragnar
Тема Re: Anything I can do to speed up this query?
Дата
Msg-id 1165358111.24477.68.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Anything I can do to speed up this query?  (Wei Weng <wweng@kencast.com>)
Список pgsql-general
On þri, 2006-12-05 at 15:56 -0500, Wei Weng wrote:
> I have a table that has roughly 200,000 entries and many columns.
>
> SELECT Field1, Field2, Field3... FieldN FROM TargetTable;

> The thing is on this machine with 1Gig Ram, the above query still takes
> about 20 seconds to finish. And I need it to run faster, ideally around
> 5 seconds.

> Test=> show shared_buffers ;
>  shared_buffers
> ----------------
>  60800

do you mean that you want the data to be cached, or do you need it to be
fast the first time?
if you want it to be cached you might be better served
with a lower shared buffers, to leave more memory tothe OS cache.

If you just need more speed reading from the disks,
you probably just need a faster disk subsystem, although
should should make sure the table does not contain
a lot of dead rows, by doing a VACUUM FULL or a CLUSTER
once before trying again.

If Field1, Field2 ... FieldN are a small subset of the
tables row-width, you should consider vertical
partitioning, to minimize IO needed for this particular
query, although this will not help much if the subset is
not fixed.

gnari



В списке pgsql-general по дате отправления:

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Row-based authorization
Следующее
От: "Mike G"
Дата:
Сообщение: Re: Speed of postgres compared to ms sql, is this