Re: Table scan on 15.2

2023-03-15 Thread Arthur Ramsey
What's strange is that there is only 1 non-unique value in the column. >

Re: Table scan on 15.2

2023-03-15 Thread Arthur Ramsey
That worked, thanks. I was trying to find how to do that in pgsql.

Re: Table scan on 15.2

2023-03-15 Thread Tom Lane
Arthur Ramsey writes: > After a restart and seq disabled for session with no other load (same for > plan with seq enabled). > Bitmap Heap Scan on t_user user0_ (cost=19567.17..58623.03 rows=800678 > width=761) (actual time=0.370..0.702 rows=36 loops=1) So the problem is that awful rowcount est

Re: Table scan on 15.2

2023-03-15 Thread Arthur Ramsey
After a restart and seq disabled for session with no other load (same for plan with seq enabled). Bitmap Heap Scan on t_user user0_ (cost=19567.17..58623.03 rows=800678 width=761) (actual time=0.370..0.702 rows=36 loops=1) Recheck Cond: (upper((username)::text) = ANY ('{[redacted]'::text[]))

Re: Table scan on 15.2

2023-03-15 Thread Tom Lane
Arthur Ramsey writes: > I've upgraded from 12.11 to 15.2 and I'm seeing this query now use a > sequential scan which is taking 500ms instead of < 2ms. If I disable > sequential scans then it performs as well as 12.11. What does the EXPLAIN look like with seqscans disabled?

Re: Table scan on 15.2

2023-03-15 Thread Arthur Ramsey
Yes, I forgot to mention I did a REINDEX DATABASE and ANALYZE. On Wed, Mar 15, 2023 at 10:20 AM Adrian Klaver wrote: > On 3/15/23 08:17, Arthur Ramsey wrote: > > I've upgraded from 12.11 to 15.2 and I'm seeing this query now use a > > sequential scan which is taking 500ms instead of < 2ms. If I

Re: Table scan on 15.2

2023-03-15 Thread Adrian Klaver
On 3/15/23 08:17, Arthur Ramsey wrote: I've upgraded from 12.11 to 15.2 and I'm seeing this query now use a sequential scan which is taking 500ms instead of < 2ms.  If I disable sequential scans then it performs as well as 12.11. Did you run ANALYZE on the database/table in the new 15.2 instan

Table scan on 15.2

2023-03-15 Thread Arthur Ramsey
I've upgraded from 12.11 to 15.2 and I'm seeing this query now use a sequential scan which is taking 500ms instead of < 2ms. If I disable sequential scans then it performs as well as 12.11. Schema: Table "public.t_user" Column | Typ