Re: Temporarily very slow planning time after a big delete - Mailing list pgsql-performance

From Walter Smith
Subject Re: Temporarily very slow planning time after a big delete
Date
Msg-id CAOERZXje4G37KTPzQ-s-ar0mH4HG8ZVsk0ZDBmQdDiPnyOznuQ@mail.gmail.com
Whole thread Raw
In response to Re: Temporarily very slow planning time after a big delete  (Walter Smith <walter@carezone.com>)
List pgsql-performance
Tom Lane <tgl@sss.pgh.pa.us> 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


pgsql-performance by date:

Previous
From: Walter Smith
Date:
Subject: Re: Temporarily very slow planning time after a big delete
Next
From: David Rowley
Date:
Subject: Re: Temporarily very slow planning time after a big delete