Re: Index no longer being used, destroying and recreating it restores use.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Koen De Groote <kdg(dot)dev(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Index no longer being used, destroying and recreating it restores use.
Date: 2020-06-04 16:43:32
Message-ID: 1251078.1591289012@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Koen De Groote <kdg(dot)dev(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-06-04 16:48:28 Re: Index no longer being used, destroying and recreating it restores use.
Previous Message Adrian Klaver 2020-06-04 16:29:27 Re: Index no longer being used, destroying and recreating it restores use.