Anything I can do to speed up this query?

Поиск
Список
Период
Сортировка
От Wei Weng
Тема Anything I can do to speed up this query?
Дата
Msg-id 1165352175.8448.8.camel@localhost.localdomain
обсуждение исходный текст
Ответы Re: Anything I can do to speed up this query?  (Jan de Visser <jdevisser@digitalfairway.com>)
Re: Anything I can do to speed up this query?  (Wei Weng <wweng@kencast.com>)
Re: Anything I can do to speed up this query?  (Scott Marlowe <smarlowe@g2switchworks.com>)
Re: Anything I can do to speed up this query?  (Alexander Staubo <alex@purefiction.net>)
Re: Anything I can do to speed up this query?  (Ron Johnson <ron.l.johnson@cox.net>)
Re: Anything I can do to speed up this query?  (Ragnar <gnari@hive.is>)
Re: Anything I can do to speed up this query?  (Richard Huxton <dev@archonet.com>)
Re: Anything I can do to speed up this query?  (Wei Weng <wweng@kencast.com>)
Список pgsql-general
I have a table that has roughly 200,000 entries and many columns.

The query is very simple:

SELECT Field1, Field2, Field3... FieldN FROM TargetTable;

TargetTable has an index that is Field1.

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.

I already increased the following configurations:

Test=> show sort_mem;
  sort_mem
----------
  262144
(1 row)

Test=> show shared_buffers ;
 shared_buffers
----------------
 60800
(1 row)


And the EXPLAIN ANALYZE result is also as follows:

                                                                QUERY
PLAN

-------------------------------------------------------------------------------------------------------------------------------------------
 Seq Scan on TargetTable  (cost=0.00..28471.72 rows=210872 width=988)
(actual time=0.037..6084.385 rows=211286 loops=1)
 Total runtime: 6520.499 ms

what else can I improve? Thanks in advance


Wei



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Unable to restart postgres - database system was interrupted
Следующее
От: Glen Parker
Дата:
Сообщение: Re: HELP: Urgent, Vacuum problem