From fd267c1ebc363ae6b1bf586794fa5cc9e8cca43c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 11 Feb 2006 23:31:34 +0000 Subject: 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. --- doc/src/sgml/indexam.sgml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/indexam.sgml b/doc/src/sgml/indexam.sgml index 7480c98a15b..d766467bdb4 100644 --- a/doc/src/sgml/indexam.sgml +++ b/doc/src/sgml/indexam.sgml @@ -1,5 +1,5 @@ @@ -200,6 +200,12 @@ ambulkdelete (Relation indexRelation, struct containing statistics about the effects of the deletion operation. + + If 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. + + IndexBulkDeleteResult * -- cgit v1.2.3