You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ORCA: fall back to Postgres planner for KNN ORDER BY queries
ORCA is unaware of amcanorderbyop, so it plans "ORDER BY col <-> val"
queries with a full Seq Scan + Sort instead of a native KNN ordered
index scan. Detect this pattern by checking whether any ORDER BY
target is an operator with amoppurpose = AMOP_ORDER in pg_amop and at
least one direct Var argument, then raise ExmiQuery2DXLUnsupportedFeature
to hand the query off to the Postgres planner, which generates an
efficient Index Only Scan with native KNN ordering.
Queries where the ordering operator's arguments are entirely computed
expressions (e.g. circle(col,1) <-> point(0,0)) are excluded from the
fallback to avoid lossy-distance errors in index-only scans.
0 commit comments