Re: Optimizing count(), but Explain estimates wildly off

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Chema <chema(at)interneta(dot)org>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Optimizing count(), but Explain estimates wildly off
Date: 2024-03-01 08:57:13
Message-ID: 822fd29fb50b8a8035fd91efa309754b3a02c439.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, 2024-02-29 at 17:15 -0600, Chema wrote:
> No major changes after doing Analyze, and also Vacuum Analyze.

Indeed.

This caught my attention:

> -> Parallel Seq Scan on pricescope_items (cost=0.00..1027794.01 rows=3277101 width=522) (actual time=0.753..41654.507 rows=2621681 loops=3)

Why does it take over 41 seconds to read a table with less than
3 million rows? Are the rows so large? Is the tabe bloated?
What is the size of the table as measured with pg_relation_size()
and pg_table_size()?

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Chema 2024-03-04 19:13:56 Re: Optimizing count(), but Explain estimates wildly off
Previous Message Alvaro Herrera 2024-03-01 07:35:41 Re: FW: huge SubtransSLRU and SubtransBuffer wait_event