]> granicus.if.org Git - postgresql/blobdiff - src/backend/executor/nodeAgg.c
Add an at-least-marginally-plausible method of estimating the number
[postgresql] / src / backend / executor / nodeAgg.c
index 5fa82ee9faddfa8dafa24386bf3c1d5dd9955b14..0216f8ebde7fe83f122af02ff1682614204a5630 100644 (file)
@@ -45,7 +45,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.95 2002/11/13 00:39:47 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.96 2002/11/19 23:21:57 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -619,6 +619,9 @@ lookup_hash_entry(Agg *node, TupleTableSlot *slot)
                Datum           attr;
                bool            isNull;
 
+               /* rotate hashkey left 1 bit at each step */
+               hashkey = (hashkey << 1) | ((hashkey & 0x80000000) ? 1 : 0);
+
                attr = heap_getattr(tuple, att, tupdesc, &isNull);
                if (isNull)
                        continue;                       /* treat nulls as having hash key 0 */