Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
cfc71031
Commit
cfc71031
authored
Jun 28, 2006
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust TupleHashTables to use MinimalTuple format for contained tuples.
parent
15897332
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
24 deletions
+22
-24
src/backend/executor/execGrouping.c
src/backend/executor/execGrouping.c
+14
-14
src/backend/executor/nodeAgg.c
src/backend/executor/nodeAgg.c
+4
-5
src/backend/executor/nodeSubplan.c
src/backend/executor/nodeSubplan.c
+2
-3
src/include/nodes/execnodes.h
src/include/nodes/execnodes.h
+2
-2
No files found.
src/backend/executor/execGrouping.c
View file @
cfc71031
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execGrouping.c,v 1.1
8 2006/03/05 15:58:25 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/executor/execGrouping.c,v 1.1
9 2006/06/28 17:05:49 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -389,7 +389,7 @@ LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot,
...
@@ -389,7 +389,7 @@ LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot,
/* Copy the first tuple into the table context */
/* Copy the first tuple into the table context */
MemoryContextSwitchTo
(
hashtable
->
tablecxt
);
MemoryContextSwitchTo
(
hashtable
->
tablecxt
);
entry
->
firstTuple
=
ExecCopySlotTuple
(
slot
);
entry
->
firstTuple
=
ExecCopySlot
Minimal
Tuple
(
slot
);
*
isnew
=
true
;
*
isnew
=
true
;
}
}
...
@@ -405,12 +405,12 @@ LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot,
...
@@ -405,12 +405,12 @@ LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot,
/*
/*
* Compute the hash value for a tuple
* Compute the hash value for a tuple
*
*
* The passed-in key is a pointer to TupleHashEntryData. In an actual
* The passed-in key is a pointer to TupleHashEntryData. In an actual
hash
*
hash table entry, the firstTuple field therein points to a physical
*
table entry, the firstTuple field points to a tuple (in MinimalTuple
*
tuple. LookupTupleHashEntry sets up a dummy TupleHashEntryData with
*
format). LookupTupleHashEntry sets up a dummy TupleHashEntryData with a
*
a
NULL firstTuple field --- that cues us to look at the inputslot instead.
* NULL firstTuple field --- that cues us to look at the inputslot instead.
* This convention avoids the need to materialize virtual input tuples
* This convention avoids the need to materialize virtual input tuples
unless
*
unless
they actually need to get copied into the table.
* they actually need to get copied into the table.
*
*
* CurTupleHashTable must be set before calling this, since dynahash.c
* CurTupleHashTable must be set before calling this, since dynahash.c
* doesn't provide any API that would let us get at the hashtable otherwise.
* doesn't provide any API that would let us get at the hashtable otherwise.
...
@@ -421,7 +421,7 @@ LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot,
...
@@ -421,7 +421,7 @@ LookupTupleHashEntry(TupleHashTable hashtable, TupleTableSlot *slot,
static
uint32
static
uint32
TupleHashTableHash
(
const
void
*
key
,
Size
keysize
)
TupleHashTableHash
(
const
void
*
key
,
Size
keysize
)
{
{
HeapTuple
tuple
=
((
const
TupleHashEntryData
*
)
key
)
->
firstTuple
;
MinimalTuple
tuple
=
((
const
TupleHashEntryData
*
)
key
)
->
firstTuple
;
TupleTableSlot
*
slot
;
TupleTableSlot
*
slot
;
TupleHashTable
hashtable
=
CurTupleHashTable
;
TupleHashTable
hashtable
=
CurTupleHashTable
;
int
numCols
=
hashtable
->
numCols
;
int
numCols
=
hashtable
->
numCols
;
...
@@ -439,7 +439,7 @@ TupleHashTableHash(const void *key, Size keysize)
...
@@ -439,7 +439,7 @@ TupleHashTableHash(const void *key, Size keysize)
/* Process a tuple already stored in the table */
/* Process a tuple already stored in the table */
/* (this case never actually occurs in current dynahash.c code) */
/* (this case never actually occurs in current dynahash.c code) */
slot
=
hashtable
->
tableslot
;
slot
=
hashtable
->
tableslot
;
ExecStore
Tuple
(
tuple
,
slot
,
InvalidBuffer
,
false
);
ExecStore
MinimalTuple
(
tuple
,
slot
,
false
);
}
}
for
(
i
=
0
;
i
<
numCols
;
i
++
)
for
(
i
=
0
;
i
<
numCols
;
i
++
)
...
@@ -480,10 +480,10 @@ TupleHashTableHash(const void *key, Size keysize)
...
@@ -480,10 +480,10 @@ TupleHashTableHash(const void *key, Size keysize)
static
int
static
int
TupleHashTableMatch
(
const
void
*
key1
,
const
void
*
key2
,
Size
keysize
)
TupleHashTableMatch
(
const
void
*
key1
,
const
void
*
key2
,
Size
keysize
)
{
{
HeapTuple
tuple1
=
((
const
TupleHashEntryData
*
)
key1
)
->
firstTuple
;
MinimalTuple
tuple1
=
((
const
TupleHashEntryData
*
)
key1
)
->
firstTuple
;
#ifdef USE_ASSERT_CHECKING
#ifdef USE_ASSERT_CHECKING
HeapTuple
tuple2
=
((
const
TupleHashEntryData
*
)
key2
)
->
firstTuple
;
MinimalTuple
tuple2
=
((
const
TupleHashEntryData
*
)
key2
)
->
firstTuple
;
#endif
#endif
TupleTableSlot
*
slot1
;
TupleTableSlot
*
slot1
;
TupleTableSlot
*
slot2
;
TupleTableSlot
*
slot2
;
...
@@ -497,7 +497,7 @@ TupleHashTableMatch(const void *key1, const void *key2, Size keysize)
...
@@ -497,7 +497,7 @@ TupleHashTableMatch(const void *key1, const void *key2, Size keysize)
*/
*/
Assert
(
tuple1
!=
NULL
);
Assert
(
tuple1
!=
NULL
);
slot1
=
hashtable
->
tableslot
;
slot1
=
hashtable
->
tableslot
;
ExecStore
Tuple
(
tuple1
,
slot1
,
InvalidBuffer
,
false
);
ExecStore
MinimalTuple
(
tuple1
,
slot1
,
false
);
Assert
(
tuple2
==
NULL
);
Assert
(
tuple2
==
NULL
);
slot2
=
hashtable
->
inputslot
;
slot2
=
hashtable
->
inputslot
;
...
...
src/backend/executor/nodeAgg.c
View file @
cfc71031
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.14
0 2006/06/21 18:39:42
tgl Exp $
* $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.14
1 2006/06/28 17:05:49
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -957,9 +957,8 @@ agg_retrieve_hash_table(AggState *aggstate)
...
@@ -957,9 +957,8 @@ agg_retrieve_hash_table(AggState *aggstate)
* Store the copied first input tuple in the tuple table slot reserved
* Store the copied first input tuple in the tuple table slot reserved
* for it, so that it can be used in ExecProject.
* for it, so that it can be used in ExecProject.
*/
*/
ExecStoreTuple
(
entry
->
shared
.
firstTuple
,
ExecStore
Minimal
Tuple
(
entry
->
shared
.
firstTuple
,
firstSlot
,
firstSlot
,
InvalidBuffer
,
false
);
false
);
pergroup
=
entry
->
pergroup
;
pergroup
=
entry
->
pergroup
;
...
...
src/backend/executor/nodeSubplan.c
View file @
cfc71031
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeSubplan.c,v 1.7
5 2006/06/16 18:42:22
tgl Exp $
* $PostgreSQL: pgsql/src/backend/executor/nodeSubplan.c,v 1.7
6 2006/06/28 17:05:49
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -572,8 +572,7 @@ findPartialMatch(TupleHashTable hashtable, TupleTableSlot *slot)
...
@@ -572,8 +572,7 @@ findPartialMatch(TupleHashTable hashtable, TupleTableSlot *slot)
ResetTupleHashIterator
(
hashtable
,
&
hashiter
);
ResetTupleHashIterator
(
hashtable
,
&
hashiter
);
while
((
entry
=
ScanTupleHashTable
(
&
hashiter
))
!=
NULL
)
while
((
entry
=
ScanTupleHashTable
(
&
hashiter
))
!=
NULL
)
{
{
ExecStoreTuple
(
entry
->
firstTuple
,
hashtable
->
tableslot
,
ExecStoreMinimalTuple
(
entry
->
firstTuple
,
hashtable
->
tableslot
,
false
);
InvalidBuffer
,
false
);
if
(
!
execTuplesUnequal
(
hashtable
->
tableslot
,
slot
,
if
(
!
execTuplesUnequal
(
hashtable
->
tableslot
,
slot
,
numCols
,
keyColIdx
,
numCols
,
keyColIdx
,
hashtable
->
eqfunctions
,
hashtable
->
eqfunctions
,
...
...
src/include/nodes/execnodes.h
View file @
cfc71031
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.15
0 2006/04/30 18:30:40
tgl Exp $
* $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.15
1 2006/06/28 17:05:49
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -367,7 +367,7 @@ typedef struct TupleHashTableData *TupleHashTable;
...
@@ -367,7 +367,7 @@ typedef struct TupleHashTableData *TupleHashTable;
typedef
struct
TupleHashEntryData
typedef
struct
TupleHashEntryData
{
{
/* firstTuple must be the first field in this struct! */
/* firstTuple must be the first field in this struct! */
HeapTuple
firstTuple
;
/* copy of first tuple in this group */
MinimalTuple
firstTuple
;
/* copy of first tuple in this group */
/* there may be additional data beyond the end of this struct */
/* there may be additional data beyond the end of this struct */
}
TupleHashEntryData
;
/* VARIABLE LENGTH STRUCT */
}
TupleHashEntryData
;
/* VARIABLE LENGTH STRUCT */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment