Re: Index only select count(*)

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Index only select count(*)
Дата
Msg-id 00C74014-70EB-4A9A-8E5D-A6E8FC60EAAF@gmail.com
обсуждение исходный текст
Ответ на Re: Index only select count(*)  (Toni Helenius <Toni.Helenius@syncrontech.com>)
Ответы Re: Index only select count(*)  (Toni Helenius <Toni.Helenius@syncrontech.com>)
Список pgsql-general
On Oct 7, 2013, at 11:34, Toni Helenius <Toni.Helenius@syncrontech.com> wrote:

> Hi,
>
> yes, I'm cheating by using GUI :) (PgAdmin)

Please do not top-post.

Analyze is an entirely different command than Explain analyze. Analyze updates the statistics of tables, while Explain
analyzetells how those statistics affect the query plan. 

> Here:
>
> "Aggregate  (cost=18240.50..18240.51 rows=1 width=0) (actual time=2911.117..2911.119 rows=1 loops=1)"
> "  ->  Seq Scan on min1_009  (cost=0.00..18108.60 rows=52760 width=0) (actual time=5.390..2816.274 rows=52760
loops=1)"
> "Total runtime: 2912.211 ms"

That article you referenced mentions pg_class.relallvisible - what value does that have for your table?
Is it possible that a relatively large amount of the data in that table is not visible to other sessions, or was that
perhapsthe case when you last (vacuum) analyzed the table? 

What is the plan if you set enable_seqscan = off; in your session? Does that give any more insight?

> -----Original Message-----
> From: Alban Hertroys [mailto:haramrae@gmail.com]
> Sent: 7. lokakuuta 2013 12:31
> To: Toni Helenius
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Index only select count(*)
>
> On Oct 7, 2013, at 11:23, Toni Helenius <Toni.Helenius@syncrontech.com> wrote:
>
>> The output of analyze:
>> "Aggregate  (cost=18240.50..18240.51 rows=1 width=0)"
>> "  ->  Seq Scan on min1_009  (cost=0.00..18108.60 rows=52760 width=0)"
>
> That's the output of Explain, not of Explain Analyze. The latter has actual measurements to go with the estimated
costs,which gives a lot more insight. 
>
> Alban Hertroys
> --
> If you can't see the forest for the trees, cut the trees and you'll find there is no forest.
>

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



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

Предыдущее
От: Toni Helenius
Дата:
Сообщение: Re: Index only select count(*)
Следующее
От: Toni Helenius
Дата:
Сообщение: Re: Index only select count(*)