GIN JSONB path index is not always used

2023-10-17 Thread Tomasz Szymański
Hello! We have an issue with database planner choosing really expensive sequence scan instead of an index scan in some cases. I'm reaching out in order to maybe get some idea on what we're dealing with / what could be the actual issue here. The table affected is the users table with a field calle

Re: GIN JSONB path index is not always used

2023-10-17 Thread Laurenz Albe
On Tue, 2023-10-17 at 15:48 +0200, Tomasz Szymański wrote: > Hello! We have an issue with database planner choosing really expensive > sequence scan instead of an index scan in some cases. To analyze that, we'd need the output from EXPLAIN (ANALYZE, BUFFERS) SELECT ... Plain text format please, n

Re: GIN JSONB path index is not always used

2023-10-17 Thread Jeff Janes
On Tue, Oct 17, 2023 at 10:09 AM Tomasz Szymański wrote: > - Database version: 11.18 That is pretty old. It is 3 bug-fix releases out of date even for its major version, and the major version itself is just about to reach EOL and is missing relevant improvements. - Plan when it uses an index >