Re: [HACKERS] Highly Variable Planning Times - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Highly Variable Planning Times
Date
Msg-id 30419.1492635518@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] Highly Variable Planning Times  (Michael Malis <michaelmalis2@gmail.com>)
Responses Re: [HACKERS] Highly Variable Planning Times  (Michael Malis <michaelmalis2@gmail.com>)
List pgsql-hackers
Michael Malis <michaelmalis2@gmail.com> writes:
> I've been encountering highly variable planning time on PG 9.5.4.
> Running `EXPLAIN SELECT * FROM events_1171738` will take anywhere from
> 200ms to 4s. This likely has to do with the table having 1300 partial
> indexes on it (for reasons elaborated on in
> https://blog.heapanalytics.com/running-10-million-postgresql-indexes-in-production/).

TBH, I see no convincing explanation in that article of why 1300 partial
indexes are a good idea.  *At best*, you're doing substantial work in the
planner to avoid the first tree descent step or two in a single
non-partial index.  At worst, all your savings go out the window during a
relcache flush, which is likely to happen whenever a vacuum or analyze
gets done on the underlying table.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] Highly Variable Planning Times
Next
From: Michael Malis
Date:
Subject: Re: [HACKERS] Highly Variable Planning Times