mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Use PG_GETARG_TEXT_PP instead of PG_GETARG_TEXT_P in the new
gin_cmp_tslexeme and gin_cmp_prefix functions. Should shave off a few cycles from GIN operations.
This commit is contained in:
parent
2c69fa0c38
commit
b64d966deb
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/tsginidx.c,v 1.12 2008/05/16 16:31:01 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/tsginidx.c,v 1.13 2008/12/02 11:30:53 heikki Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -22,13 +22,13 @@
|
|||||||
Datum
|
Datum
|
||||||
gin_cmp_tslexeme(PG_FUNCTION_ARGS)
|
gin_cmp_tslexeme(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
text *a = PG_GETARG_TEXT_P(0);
|
text *a = PG_GETARG_TEXT_PP(0);
|
||||||
text *b = PG_GETARG_TEXT_P(1);
|
text *b = PG_GETARG_TEXT_PP(1);
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
cmp = tsCompareString(
|
cmp = tsCompareString(
|
||||||
VARDATA(a), VARSIZE(a) - VARHDRSZ,
|
VARDATA_ANY(a), VARSIZE_ANY_EXHDR(a),
|
||||||
VARDATA(b), VARSIZE(b) - VARHDRSZ,
|
VARDATA_ANY(b), VARSIZE_ANY_EXHDR(b),
|
||||||
false );
|
false );
|
||||||
|
|
||||||
PG_FREE_IF_COPY(a,0);
|
PG_FREE_IF_COPY(a,0);
|
||||||
@ -39,16 +39,16 @@ gin_cmp_tslexeme(PG_FUNCTION_ARGS)
|
|||||||
Datum
|
Datum
|
||||||
gin_cmp_prefix(PG_FUNCTION_ARGS)
|
gin_cmp_prefix(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
text *a = PG_GETARG_TEXT_P(0);
|
text *a = PG_GETARG_TEXT_PP(0);
|
||||||
text *b = PG_GETARG_TEXT_P(1);
|
text *b = PG_GETARG_TEXT_PP(1);
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
StrategyNumber strategy = PG_GETARG_UINT16(2);
|
StrategyNumber strategy = PG_GETARG_UINT16(2);
|
||||||
#endif
|
#endif
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
cmp = tsCompareString(
|
cmp = tsCompareString(
|
||||||
VARDATA(a), VARSIZE(a) - VARHDRSZ,
|
VARDATA_ANY(a), VARSIZE_ANY_EXHDR(a),
|
||||||
VARDATA(b), VARSIZE(b) - VARHDRSZ,
|
VARDATA_ANY(b), VARSIZE_ANY_EXHDR(b),
|
||||||
true );
|
true );
|
||||||
|
|
||||||
if ( cmp < 0 )
|
if ( cmp < 0 )
|
||||||
|
Loading…
Reference in New Issue
Block a user