PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ gserialized_gist_penalty_2d()

Datum gserialized_gist_penalty_2d ( PG_FUNCTION_ARGS  )

Definition at line 1268 of file gserialized_gist_2d.c.

1269 {
1270  GISTENTRY *origentry = (GISTENTRY*) PG_GETARG_POINTER(0);
1271  GISTENTRY *newentry = (GISTENTRY*) PG_GETARG_POINTER(1);
1272  float *result = (float*) PG_GETARG_POINTER(2);
1273  BOX2DF *b1, *b2;
1274 
1275  b1 = (BOX2DF *)DatumGetPointer(origentry->key);
1276  b2 = (BOX2DF *)DatumGetPointer(newentry->key);
1277 
1278  /* Penalty value of 0 has special code path in Postgres's gistchoose.
1279  * It is used as an early exit condition in subtree loop, allowing faster tree descend.
1280  * For multi-column index, it lets next column break the tie, possibly more confidently.
1281  */
1282  *result = 0;
1283 
1284  if (b1 && b2 && !box2df_is_empty(b1) && !box2df_is_empty(b2))
1285  *result = box2df_penalty(b1, b2);
1286 
1287  PG_RETURN_POINTER(result);
1288 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:267
bool box2df_is_empty(const BOX2DF *a)
static float box2df_penalty(const BOX2DF *b1, const BOX2DF *b2)

References box2df_is_empty(), box2df_penalty(), and result.

Here is the call graph for this function: