Re: Top -N Query performance issue and high CPU usage - Mailing list pgsql-general

From yudhi s
Subject Re: Top -N Query performance issue and high CPU usage
Date
Msg-id CAEzWdqd6LAHs+FiFeJLqDTS-QBLq6+foE1-mgBC9AXVpFmVnZg@mail.gmail.com
Whole thread Raw
In response to Re: Top -N Query performance issue and high CPU usage  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Top -N Query performance issue and high CPU usage
List pgsql-general
Thank you. 

1) Without even looking at the plan I'm going to say 2-VCPU and 16GB RAM
and is insufficient resources for what you want to do.


Can you please explain a bit in detail, how much minimum VCPU and RAM will be enough resources to suffice this requirement? and you normally do that calculation?
 
2) You will need to provide the schema definitions for the tables involved.

Do you mean table DDL or just the index definitions on the tables should help?

Also i was trying to understand , by just looking into the "explain analyze" output, is there any way we can tie the specific step in the plan , which is the major contributor of the cpu resources? Such that we can then try to fix that part rather than looking throughout the query as its big query?  

And if any suggestion to improve the TOP-N queries where the base table may have many rows in it.

pgsql-general by date:

Previous
From: yudhi s
Date:
Subject: Re: Top -N Query performance issue and high CPU usage
Next
From: Ron Johnson
Date:
Subject: Re: Top -N Query performance issue and high CPU usage