Files
documentdb/pg_helio_api/sql/udfs/query/bson_dollar_selectivity--latest.sql
T
Vinod Sridharan cf88b82fe7 Merged PR 1332248: Selectivity Part 1: Implement operator statistics behind a flag
### Does this PR have any customer impact?
No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
Yes

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
N/A
### Description
Implement statistics for bson Dollar functions behind a feature flag. This uses the default Postgres operator statistics using Most Common Value and Histogram stats if available to compute.

As a fallback it also uses operator data to provide default values if needed.

Sets up an ANALYZE function on bson so that this can be improved (since the ANALYZE is not there yet). This will be done in a subsequent change.
2024-04-26 16:19:32 +03:00

5 lines
237 B
SQL

CREATE OR REPLACE FUNCTION helio_api_internal.bson_dollar_selectivity(internal, oid, internal, integer)
RETURNS double precision
LANGUAGE c
STABLE PARALLEL SAFE STRICT
AS 'MODULE_PATHNAME', $function$bson_dollar_selectivity$function$;