Skip to content

Commit

Permalink
fix: revert set amoptionalkey to false
Browse files Browse the repository at this point in the history
Signed-off-by: usamoi <[email protected]>
  • Loading branch information
usamoi committed Mar 17, 2024
1 parent b40a93b commit 75bf6b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index/am.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ const AM_HANDLER: pgrx::pg_sys::IndexAmRoutine = {

am_routine.amcanorderbyop = true;

// Index access methods that set `amoptionalkey` to `false`
// must index all tuples, even if the first column is `NULL`.
// However, PostgreSQL does not generate a path if there is no
// index clauses, even if there is a `ORDER BY` clause.
// So we have to set it to `true` and set costs of every path
// for vector index scans without `ORDER BY` clauses a large number
// and throw errors if someone really wants such a path.
am_routine.amoptionalkey = true;

am_routine.amvalidate = Some(amvalidate);
am_routine.amoptions = Some(amoptions);
am_routine.amcostestimate = Some(amcostestimate);
Expand Down

0 comments on commit 75bf6b9

Please sign in to comment.