Re: select query does not pick up the right index

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Abadie Lana <Lana(dot)Abadie(at)iter(dot)org>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: select query does not pick up the right index
Date: 2019-01-03 23:47:43
Message-ID: 20190103234743.GU25379@telsasoft.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Jan 03, 2019 at 12:57:27PM +0000, Abadie Lana wrote:
> Main parameters : effective_cache_size : 4GB, shared_buffers 4GB, work_mem 4MB

I doubt it will help much, but you should consider increasing work_mem, unless
you have many expensive queries running at once.

Could you also send the rest of the pg_statistic for that table ?

https://wiki.postgresql.org/wiki/Slow_Query_Questions#Statistics:_n_distinct.2C_MCV.2C_histogram

SELECT (SELECT sum(x) FROM unnest(most_common_freqs) x) frac_MCV, tablename, attname, null_frac, n_distinct, array_length(most_common_vals,1) n_mcv, array_length(histogram_bounds,1) n_hist FROM pg_stats WHERE attname='...' AND tablename='...' ORDER BY 1 DESC;

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Abadie Lana 2019-01-04 08:10:44 RE: select query does not pick up the right index
Previous Message David Rowley 2019-01-03 21:42:28 Re: select query does not pick up the right index