1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Tweak processing of multiple-index-scan plans to reduce overhead when

handling many-way scans: instead of re-evaluating all prior indexscan
quals to see if a tuple has been fetched more than once, use a hash table
indexed by tuple CTID.  But fall back to the old way if the hash table
grows to exceed SortMem.
This commit is contained in:
Tom Lane
2003-08-22 20:26:43 +00:00
parent 38e2bf6283
commit 92ee2528d8
2 changed files with 153 additions and 31 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: execnodes.h,v 1.104 2003/08/19 01:13:41 tgl Exp $
* $Id: execnodes.h,v 1.105 2003/08/22 20:26:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -768,6 +768,8 @@ typedef ScanState SeqScanState;
* RuntimeKeysReady true if runtime Skeys have been computed
* RelationDescs ptr to array of relation descriptors
* ScanDescs ptr to array of scan descriptors
* DupHash hashtable for recognizing dups in multiple scan
* MaxHash max # entries we will allow in hashtable
* ----------------
*/
typedef struct IndexScanState
@ -785,6 +787,8 @@ typedef struct IndexScanState
bool iss_RuntimeKeysReady;
RelationPtr iss_RelationDescs;
IndexScanDescPtr iss_ScanDescs;
HTAB *iss_DupHash;
long iss_MaxHash;
} IndexScanState;
/* ----------------