agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
Identify columns that need indexes
2+ messages / 2 participants
[nested] [flat]

* Identify columns that need indexes
@ 2020-11-12 07:50  Yambu <hyambu@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Yambu @ 2020-11-12 07:50 UTC (permalink / raw)
  To: pgsql-sql@lists.postgresql.org

Hi

May I know if there is a query I can run to identify the columns that need
indexes. I know I can get tables that are having high sequential scans
,what I need is to identify are the columns.

regards

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Identify columns that need indexes
@ 2020-11-12 11:14  hubert depesz lubaczewski <depesz@depesz.com>
  parent: Yambu <hyambu@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: hubert depesz lubaczewski @ 2020-11-12 11:14 UTC (permalink / raw)
  To: Yambu <hyambu@gmail.com>; +Cc: pgsql-sql@lists.postgresql.org

On Thu, Nov 12, 2020 at 09:50:03AM +0200, Yambu wrote:
> May I know if there is a query I can run to identify the columns that need
> indexes. I know I can get tables that are having high sequential scans
> ,what I need is to identify are the columns.

Not really, as this would be in AI territory.
There can be queries that will find, for example, fkeys that are not
indexed. Or some other subset of problems.
But general "query that will tell me where to put index" - no.

The usual solution is to analyze logs, find queries that use most time,
and optimize them.

depesz





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-11-12 11:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 07:50 Identify columns that need indexes Yambu <hyambu@gmail.com>
2020-11-12 11:14 ` hubert depesz lubaczewski <depesz@depesz.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox