mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Enclosed below I have a patch to allow a btree index on the int8 type.
I would like some feedback on what the hash function for the int8 hash function in the ./backend/access/hash/hashfunc.c should return. Also, could someone (maybe Tomas Lockhart?) look-over the patch and make sure the system table entries are correct? I've tried to research them as much as I could, but some of them are still not clear to me. Thanks, -Ryan
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.13 1999/02/13 23:14:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.14 1999/03/14 05:08:55 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These functions are stored in pg_amproc. For each operator class
|
||||
@@ -32,6 +32,12 @@ hashint4(uint32 key)
|
||||
return ~key;
|
||||
}
|
||||
|
||||
uint32
|
||||
hashint8(uint64 *key)
|
||||
{
|
||||
return ~((uint32)key);
|
||||
}
|
||||
|
||||
/* Hash function from Chris Torek. */
|
||||
uint32
|
||||
hashfloat4(float32 keyp)
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.21 1999/02/13 23:14:31 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.22 1999/03/14 05:08:56 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These functions are stored in pg_amproc. For each operator class
|
||||
@@ -39,6 +39,17 @@ btint4cmp(int32 a, int32 b)
|
||||
return a - b;
|
||||
}
|
||||
|
||||
int32
|
||||
btint8cmp(int64 *a, int64 *b)
|
||||
{
|
||||
if (*a > *b)
|
||||
return 1;
|
||||
else if (*a == *b)
|
||||
return 0;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
int32
|
||||
btint24cmp(int16 a, int32 b)
|
||||
{
|
||||
|
Reference in New Issue
Block a user