Re: Why Postgres doesn't use TID scan?

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vladimir Ryabtsev <greatvovan@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Date: 2018-12-18T02:32:51Z
Lists: pgsql-performance
Vladimir Ryabtsev <greatvovan@gmail.com> writes:
> I see some recommendations in Internet to do like this (e.g.
> https://stackoverflow.com/questions/5170546/how-do-i-delete-a-fixed-number-of-rows-with-sorting-in-postgresql
> ).
> Did it really work in 2011?

No, or at least not any better than today.  (For context, "git blame"
says I wrote the comment I just quoted to you in 2005.  The feature it
says isn't there wasn't there before that, either.)

> Anyway I think the problem is pretty clear: I want to eventually clear the
> table based on the predicate but I don't want to lock it for a long time.

DELETE doesn't lock the whole table.  What problem are you actually
facing?

			regards, tom lane