Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita45f4c2

Browse files
committed
/contrib/btree_gist adjustments for new 'day' interval value.
1 parentddc038c commita45f4c2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎contrib/btree_gist/btree_interval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ intr2num(const Interval *i)
8989
return (ret);
9090
}
9191

92-
#defineINTERVALSIZE12
92+
#defineINTERVALSIZE16
9393

9494
staticconstgbtree_ninfotinfo=
9595
{

‎contrib/btree_gist/btree_time.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,15 @@ gbt_time_penalty(PG_FUNCTION_ARGS)
221221
P_TimeADTGetDatum(origentry->upper)));
222222

223223
/* see interval_larger */
224-
res=Max(intr->time+intr->month* (30*86400),0);
224+
res=Max(intr->time+intr->day*86400+intr->month* (30*86400),0);
225225

226226
intr=DatumGetIntervalP(DirectFunctionCall2(
227227
time_mi_time,
228228
P_TimeADTGetDatum(origentry->lower),
229229
P_TimeADTGetDatum(newentry->lower)));
230230

231231
/* see interval_larger */
232-
res+=Max(intr->time+intr->month* (30*86400),0);
232+
res+=Max(intr->time+intr->day*86400+intr->month* (30*86400),0);
233233

234234
*result=0.0;
235235

@@ -240,7 +240,7 @@ gbt_time_penalty(PG_FUNCTION_ARGS)
240240
P_TimeADTGetDatum(origentry->upper),
241241
P_TimeADTGetDatum(origentry->lower)));
242242
*result+=FLT_MIN;
243-
*result+= (float) (res / ((double) (res+intr->time+intr->month* (30*86400))));
243+
*result+= (float) (res / ((double) (res+intr->time+intr->day*86400+intr->month* (30*86400))));
244244
*result *= (FLT_MAX / (((GISTENTRY*)PG_GETARG_POINTER(0))->rel->rd_att->natts+1));
245245
}
246246

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp