Re: Top -N Query performance issue and high CPU usage

From: yudhi s <learnerdatabase99(at)gmail(dot)com>
To: David Mullineux <dmullx(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Top -N Query performance issue and high CPU usage
Date: 2026-01-31 19:39:47
Message-ID: CAEzWdqdVG=_6pFjPGHrFnq7+_vLXM1-Z=zH09WnCg9aZukY=XQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
>
>>
> Plan says it's using temp files for sorting....I would suggest you
> increase work_mem for this to avoid temp.fike creation...Although not the
> answer to all your problems, it would be a good start .
>
>
Even setting work_mem to 64MB remove all the "temp read" and showig all
memory reads, but still we are seeing similar cpu spike when executing this
query from multiple sessions and also the response time is staying same.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message yudhi s 2026-01-31 19:46:56 Re: Top -N Query performance issue and high CPU usage
Previous Message Adrian Klaver 2026-01-31 16:14:48 Re: Top -N Query performance issue and high CPU usage