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

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Chema <chema(at)interneta(dot)org>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Optimizing count(), but Explain estimates wildly off
Date: 2024-03-05 01:50:00
Message-ID: CAKAnmmJ2A15dr4XUKF3A=a_Z2VryHPoZSMRvJYZmrsKKuiuYMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Mar 4, 2024 at 2:14 PM Chema <chema(at)interneta(dot)org> wrote:

> There's one JSON column in each table with a couple fields, and a column
> with long texts in Items.

and earlier indicated the query was:

> Select * from tenders inner join items

You do not want to do a "select star" on both tables unless you 100% need
every single column and plan to actively do something with it. Especially
true for large text and json columns. Also, use jsonb not json.

Cheers,
Greg

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message sud 2024-03-05 05:20:19 Re: Is partition pruning impacted by data type
Previous Message sud 2024-03-04 19:39:16 Is partition pruning impacted by data type