Re: Large tables, ORDER BY and sequence/index scans

Поиск
Список
Период
Сортировка
От Milan Zamazal
Тема Re: Large tables, ORDER BY and sequence/index scans
Дата
Msg-id 87ocl84mih.fsf@blackbird.nest.zamazal.org
обсуждение исходный текст
Ответ на Re: Large tables, ORDER BY and sequence/index scans  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Large tables, ORDER BY and sequence/index scans  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
>>>>> "PS" == Pavel Stehule <pavel.stehule@gmail.com> writes:

    PS> please EXPLAIN ANALYZE Pavel

I see, I'm sorry.  Here are the results:

  set enable_seqscan = on;
  explain analyze declare c cursor for select * from foo2 order by value;
                                                         QUERY PLAN
   

-------------------------------------------------------------------------------------------------------------------------
   Sort  (cost=1829429.20..1854429.20 rows=9999999 width=10) (actual time=43432.727..49303.902 rows=9999999 loops=1)
     Sort Key: value
     Sort Method:  external merge  Disk: 204208kB
     ->  Seq Scan on foo2  (cost=0.00..154049.99 rows=9999999 width=10) (actual time=0.058..1775.928 rows=9999999
loops=1)
   Total runtime: 53693.012 ms
  (5 rows)

  set enable_seqscan = off;
  explain analyze declare c cursor for select * from foo2 order by value;

                                                                   QUERY PLAN
                       

---------------------------------------------------------------------------------------------------------------------------------------------
   Index Scan using foo2_value_idx on foo2  (cost=0.00..32220140.73 rows=9999999 width=10) (actual
time=0.225..55055.583rows=9999999 loops=1) 
   Total runtime: 56394.283 ms
  (2 rows)


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

Предыдущее
От: "Gauthier, Dave"
Дата:
Сообщение: Re: Shall I use PostgreSQL Array Type in The Following Case
Следующее
От: Milan Zamazal
Дата:
Сообщение: Re: Large tables, ORDER BY and sequence/index scans