NotHimmel commented on issue #2560: URL: https://github.com/apache/age/issues/2560#issuecomment-5538638857
I've been prototyping a fix and would like a discussion before opening a PR. The idea: bind `@>`/`@>>` to a new `RESTRICT` estimator that decomposes the constant map the same way `enable_containment = off` does — one equality per scalar key on `agtype_access_operator(properties, '"key"')` — and estimates each leaf with `examine_variable()` + `var_eq_const()`, so it picks up whatever expression index or `CREATE STATISTICS` the user already has on that key. Inline map and `WHERE n.key = v` then estimate identically. It never touches the `properties` column's stats and never calls `agtype_contains()`, so the #2356 planning-time regression can't come back (measured +5–16% over `contsel` vs +83% for `matchingsel`), and when the relation has no expression statistics at all it returns the same 0.001 `contsel` does, so existing installs see identical plans. Does this direction look reasonable? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
