Re: Bitmap scan seem like such a strange choice when "limit 1"

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Klaudie Willis <Klaudie(dot)Willis(at)protonmail(dot)com>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Bitmap scan seem like such a strange choice when "limit 1"
Date: 2020-09-04 17:12:26
Message-ID: CAHOFxGqidWg1hQF9a2hGZk1NJTbMAV2bNYqha+HPye8rA+dTMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Index Scan using bigtable_y2020_cars_ref_idx on bigtable_y2020 bigtable
(cost=0.57..2966738.51 rows=2873818 width=636) (actual time=0.026..0.026
rows=1 loops=1)

Given the system expects to get almost 3 million rows when it should be
just 1, it seems like a stats problem to me. How is ndistinct on that
column compared to reality?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2020-09-05 12:31:50 Re: ODBC Driver dsplay name
Previous Message Ben Chobot 2020-09-04 17:03:50 Re: 12.3 replicas falling over during WAL redo