Sequential scan faster than index - Mailing list pgsql-general

From Arthur Ramsey
Subject Sequential scan faster than index
Date
Msg-id CAEJqy4UbHAbVJXygE1CuYuwm1ZRRK+iwgh=0VW8O3mkPwMManQ@mail.gmail.com
Whole thread Raw
Responses Re: Sequential scan faster than index  (Luca Ferrari <fluca1978@gmail.com>)
Re: Sequential scan faster than index  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-general
I'm trying to figure out why a sequential scan is out performing.  I've tried psql 13.7, psql14.6 and REINDEX.  The REINDEX didn't help.  This is on an RDS instance that's a db.m5.large (2 * vCPU, 8 GB memory) with 200 storage on io1 with 10000 provisioned IOPS.  I restarted the RDS instance in between each test.

Schema: https://pastebin.com/bZvTLYGa

psql 13.7: https://pastebin.com/QtHXJtxq
psql 14.6: https://pastebin.com/PfVbCPJp
psql 14.6 with enable_seqscan=OFF: https://pastebin.com/i0g2NfUh
psql 14.6 with enable_sort=OFF: https://pastebin.com/9v9SGunw

Thanks,
Arthur

pgsql-general by date:

Previous
From: Ben Chrobot
Date:
Subject: Re: Query plan for "id IS NULL" on PK
Next
From: Peter Geoghegan
Date:
Subject: Re: Automatic aggressive vacuum on almost frozen table takes too long