1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-20 15:22:23 +03:00

Skip ambulkdelete scan if there's nothing to delete and the index is not

partial.  None of the existing AMs do anything useful except counting
tuples when there's nothing to delete, and we can get a tuple count
from the heap as long as it's not a partial index.  (hash actually can
skip anyway because it maintains a tuple count in the index metapage.)
GIST is not currently able to exploit this optimization because, due to
failure to index NULLs, GIST is always effectively partial.  Possibly
we should fix that sometime.
Simon Riggs w/ some review by Tom Lane.
This commit is contained in:
Tom Lane
2006-02-11 23:31:34 +00:00
parent a02f6ce33b
commit fd267c1ebc
8 changed files with 108 additions and 31 deletions

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/indexam.sgml,v 2.7 2005/11/04 23:14:00 petere Exp $
$PostgreSQL: pgsql/doc/src/sgml/indexam.sgml,v 2.8 2006/02/11 23:31:32 tgl Exp $
-->
<chapter id="indexam">
@ -200,6 +200,12 @@ ambulkdelete (Relation indexRelation,
struct containing statistics about the effects of the deletion operation.
</para>
<para>
If <literal>callback_state</> is NULL then no tuples are to be deleted.
The index AM may choose to optimize this case (eg by not scanning the
index) but it is still expected to deliver accurate statistics.
</para>
<para>
<programlisting>
IndexBulkDeleteResult *