Re: SELECT DISTINCT chooses parallel seqscan instead of indexscan on huge table with 1000 partitions

From: Dimitrios Apostolou <jimis(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org, David Rowley <dgrowleyml(at)gmail(dot)com>
Subject: Re: SELECT DISTINCT chooses parallel seqscan instead of indexscan on huge table with 1000 partitions
Date: 2024-05-14 16:14:45
Message-ID: 5dfcb84a-2d32-8dde-772b-4305a7468774@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 14 May 2024, Dimitrios Apostolou wrote:
>
> It took long but if finished:
>
> ANALYZE
> Time: 19177398.025 ms (05:19:37.398)

I see now that default_statistics_target is globally set to 500, so this
is probably the reason it took so long. I guess with the default of 100,
it would take approximately one hour. This is much better to have in a
cron job. :-)

Dimitris

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dimitrios Apostolou 2024-05-14 18:11:26 Re: SELECT DISTINCT chooses parallel seqscan instead of indexscan on huge table with 1000 partitions
Previous Message Muhammad Imtiaz 2024-05-14 15:52:03 Re: Valid until