mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Inline ginCompareItemPointers function for speed.
ginCompareItemPointers function is called heavily in gin index scans - inlining it speeds up some kind of queries a lot.
This commit is contained in:
@@ -17,25 +17,6 @@
|
||||
#include "access/gin_private.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
int
|
||||
ginCompareItemPointers(ItemPointer a, ItemPointer b)
|
||||
{
|
||||
BlockNumber ba = GinItemPointerGetBlockNumber(a);
|
||||
BlockNumber bb = GinItemPointerGetBlockNumber(b);
|
||||
|
||||
if (ba == bb)
|
||||
{
|
||||
OffsetNumber oa = GinItemPointerGetOffsetNumber(a);
|
||||
OffsetNumber ob = GinItemPointerGetOffsetNumber(b);
|
||||
|
||||
if (oa == ob)
|
||||
return 0;
|
||||
return (oa > ob) ? 1 : -1;
|
||||
}
|
||||
|
||||
return (ba > bb) ? 1 : -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Merge two ordered arrays of itempointers, eliminating any duplicates.
|
||||
* Returns the number of items in the result.
|
||||
|
||||
Reference in New Issue
Block a user