mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +03:00
heap_fetch requires buffer pointer, must be released; heap_getnext
no longer returns buffer pointer, can be gotten from scan; descriptor; bootstrap can create multi-key indexes; pg_procname index now is multi-key index; oidint2, oidint4, oidname are gone (must be removed from regression tests); use System Cache rather than sequential scan in many places; heap_modifytuple no longer takes buffer parameter; remove unused buffer parameter in a few other functions; oid8 is not index-able; remove some use of single-character variable names; cleanup Buffer variables usage and scan descriptor looping; cleaned up allocation and freeing of tuples; 18k lines of diff;
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.19 1998/07/27 19:37:35 vadim Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.20 1998/08/19 02:01:00 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* This file contains only the public interface routines.
|
||||
@@ -53,7 +53,6 @@ hashbuild(Relation heap,
|
||||
PredInfo *predInfo)
|
||||
{
|
||||
HeapScanDesc hscan;
|
||||
Buffer buffer;
|
||||
HeapTuple htup;
|
||||
IndexTuple itup;
|
||||
TupleDesc htupdesc,
|
||||
@@ -65,6 +64,7 @@ hashbuild(Relation heap,
|
||||
nitups;
|
||||
int i;
|
||||
HashItem hitem;
|
||||
Buffer buffer = InvalidBuffer;
|
||||
|
||||
#ifndef OMIT_PARTIAL_INDEX
|
||||
ExprContext *econtext;
|
||||
@@ -120,14 +120,13 @@ hashbuild(Relation heap,
|
||||
}
|
||||
#endif /* OMIT_PARTIAL_INDEX */
|
||||
|
||||
/* start a heap scan */
|
||||
hscan = heap_beginscan(heap, 0, SnapshotNow, 0, (ScanKey) NULL);
|
||||
htup = heap_getnext(hscan, 0, &buffer);
|
||||
|
||||
/* build the index */
|
||||
nhtups = nitups = 0;
|
||||
|
||||
for (; HeapTupleIsValid(htup); htup = heap_getnext(hscan, 0, &buffer))
|
||||
/* start a heap scan */
|
||||
hscan = heap_beginscan(heap, 0, SnapshotNow, 0, (ScanKey) NULL);
|
||||
|
||||
while (HeapTupleIsValid(htup = heap_getnext(hscan, 0)))
|
||||
{
|
||||
|
||||
nhtups++;
|
||||
@@ -193,8 +192,7 @@ hashbuild(Relation heap,
|
||||
attoff,
|
||||
attnum,
|
||||
finfo,
|
||||
&attnull,
|
||||
buffer);
|
||||
&attnull);
|
||||
nulls[attoff] = (attnull ? 'n' : ' ');
|
||||
}
|
||||
|
||||
@@ -248,8 +246,8 @@ hashbuild(Relation heap,
|
||||
*/
|
||||
if (IsNormalProcessingMode())
|
||||
{
|
||||
hrelid = heap->rd_id;
|
||||
irelid = index->rd_id;
|
||||
hrelid = RelationGetRelid(heap);
|
||||
irelid = RelationGetRelid(index);
|
||||
heap_close(heap);
|
||||
index_close(index);
|
||||
UpdateStats(hrelid, nhtups, true);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.9 1998/04/26 04:05:08 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.10 1998/08/19 02:01:02 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These functions are stored in pg_amproc. For each operator class
|
||||
@@ -133,6 +133,18 @@ hashoid(Oid key)
|
||||
return ((uint32) ~key);
|
||||
}
|
||||
|
||||
uint32
|
||||
hashoid8(Oid key[])
|
||||
{
|
||||
int i;
|
||||
uint32 result = 0;
|
||||
|
||||
for (i=0; i < 8; i++)
|
||||
result = result ^ (~(uint32)key[i]);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#define PRIME1 37
|
||||
#define PRIME2 1048583
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.14 1998/06/15 19:27:50 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashscan.c,v 1.15 1998/08/19 02:01:04 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Because we can be doing an index scan on a relation while we
|
||||
@@ -90,7 +90,7 @@ _hash_adjscans(Relation rel, ItemPointer tid)
|
||||
HashScanList l;
|
||||
Oid relid;
|
||||
|
||||
relid = rel->rd_id;
|
||||
relid = RelationGetRelid(rel);
|
||||
for (l = HashScans; l != (HashScanList) NULL; l = l->hashsl_next)
|
||||
{
|
||||
if (relid == l->hashsl_scan->relation->rd_id)
|
||||
|
Reference in New Issue
Block a user