Re: Temporarily very slow planning time after a big delete

Walter Smith <[email protected]>
Newsgroups gmane.comp.db.postgresql.performance
Message-ID <CAOERZXje4G37KTPzQ-s-ar0mH4HG8ZVsk0ZDBmQdDiPnyOznuQ@mail.gmail.com>
Tom Lane <[email protected]> writes:
>I'm assuming your problem
>query involved a join on the indexed column --- whether or not the
>final plan did a mergejoin, the planner would consider this

There's no join -- the query is

SELECT  "notifications".*
FROM "notifications"
WHERE "notifications"."person_id" = ? AND
  "notifications"."app_category" = ? AND
  (id > ?)
ORDER BY created_at DESC
LIMIT ?

And the whole query plan is one step:

Index Scan using index_notifications_on_person_id_and_created_at on
notifications (cost=0.57..212.16 rows=52 width=231)

>Subsequent vacuuming would eventually delete the dead index entries
>and return things to normal; although usually the performance comes
>back all-of-a-sudden at the next (auto)VACUUM of the table.   So I'm
>a bit intrigued by your seeing it "gradually" improve.  Maybe you
>had old open transactions that were limiting VACUUM's ability to
>remove rows?'

We shouldn't have any long-running transactions at all, certainly not open
for a couple of hours.

Thanks,
Walter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.