1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +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

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/index/indexam.c,v 1.89 2006/02/11 17:14:08 momjian Exp $
* $PostgreSQL: pgsql/src/backend/access/index/indexam.c,v 1.90 2006/02/11 23:31:33 tgl Exp $
*
* INTERFACE ROUTINES
* index_open - open an index relation by relation OID
@@ -685,6 +685,10 @@ index_getmulti(IndexScanDesc scan,
* callback routine tells whether a given main-heap tuple is
* to be deleted
*
* if callback_state is NULL then there are no tuples to be deleted;
* index AM can choose to avoid work in this case, but must still
* follow the protocol of returning statistical info.
*
* return value is an optional palloc'd struct of statistics
* ----------------
*/