pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Koen De Groote <kdg.dev@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Index no longer being used, destroying and recreating it restores use.
Date: Thu, 04 Jun 2020 12:43:32 -0400
Message-ID: <1251078.1591289012@sss.pgh.pa.us> (raw)
In-Reply-To: <CAGbX52FL1ihuw9kWB8a2J2QPofgfDhykBENJaoyVEfTTPOvpkw@mail.gmail.com>
References: <CAGbX52FL1ihuw9kWB8a2J2QPofgfDhykBENJaoyVEfTTPOvpkw@mail.gmail.com>

Koen De Groote <kdg.dev@gmail.com> writes:
> I've got a table with about 30 million rows and a particular index that up
> until recently was actively being used.
> And then it stopped being used and the query that the index was made for,
> is now doing sequential scans.
> Deleting the index and creating it again, seems to fix the problem. The new
> index, which is identical in composition, is being used and the query in
> question no longer uses sequential scans.

It's possible that the index had bloated to the point where the planner
thought it was cheaper to use a seqscan.  Did you make a note of the
cost estimates for the different plans?

			regards, tom lane





view thread (17+ messages)  latest in thread

Message-ID: <1251078.1591289012@sss.pgh.pa.us>
Permalink:  ../1251078.1591289012@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1251078.1591289012@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, kdg.dev@gmail.com
  Subject: Re: Index no longer being used, destroying and recreating it restores use.
  In-Reply-To: <1251078.1591289012@sss.pgh.pa.us>
  References: <CAGbX52FL1ihuw9kWB8a2J2QPofgfDhykBENJaoyVEfTTPOvpkw@mail.gmail.com> <1251078.1591289012@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox