Sequential scan faster than index

From: Arthur Ramsey <arthur(dot)ramsey(at)code42(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Sequential scan faster than index
Date: 2023-02-17 16:18:09
Message-ID: CAEJqy4UbHAbVJXygE1CuYuwm1ZRRK+iwgh=0VW8O3mkPwMManQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2023-02-17 21:34:57 Re: Automatic aggressive vacuum on almost frozen table takes too long
Previous Message Ben Chrobot 2023-02-17 14:20:47 Re: Query plan for "id IS NULL" on PK