Re: CPU Consuming query. Sequential scan despite indexing.

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: aditya desai <admad123(at)gmail(dot)com>
Cc: Pgsql Performance <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: CPU Consuming query. Sequential scan despite indexing.
Date: 2020-10-15 16:26:35
Message-ID: CAHOFxGpQBgMHV67wcYd4Kz6SeCPYd3KgSx0Hi4EaQtjQDZXqUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

What version by the way? Do you get a faster execution if you disable
sequential scan? Or set parallel workers per gather to 0? Your estimates
look decent as do cache hits, so other than caching data or upgrading
hardware, not sure what else there is to be done.

Although... you are hitting 70k blocks to read only 612k rows? Are these
job records very wide perhaps, or do you need to do some vacuuming? Perhaps
autovacuum is not keeping up and you could use some repacking or vacuum
full if/when you can afford downtime. If you create a temp table copy of
the job table, how does the size compare to the live table?

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Laurenz Albe 2020-10-16 08:36:10 Re: CPU Consuming query. Sequential scan despite indexing.
Previous Message aditya desai 2020-10-15 15:04:54 CPU Consuming query. Sequential scan despite indexing.