Re: select query does not pick up the right index - Mailing list pgsql-performance

From Justin Pryzby
Subject Re: select query does not pick up the right index
Date
Msg-id 20190103234743.GU25379@telsasoft.com
Whole thread Raw
In response to RE: select query does not pick up the right index  (Abadie Lana <Lana.Abadie@iter.org>)
Responses RE: select query does not pick up the right index  (Abadie Lana <Lana.Abadie@iter.org>)
List 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; 
 


pgsql-performance by date:

Previous
From: David Rowley
Date:
Subject: Re: select query does not pick up the right index
Next
From: Abadie Lana
Date:
Subject: RE: select query does not pick up the right index