Re: [PERFORM] Slow query (wrong index used maybe)

2014-01-28 Thread Stelian Iancu
On Mon, Jan 27, 2014, at 11:43, Gavin Flower wrote: > On 28/01/14 08:10, bobJobS wrote: > > My developers have had the same issue. > > > > Postgres 9.2.3 on Linux 5.6. > > > The latest Linux kernel is 3.13 (https://www.kernel.org), so I assume > 5.6 is a distribution version. > > So which distr

Re: [PERFORM] Slow query (wrong index used maybe)

2014-01-27 Thread Stelian Iancu
On Mon, Jan 27, 2014, at 7:06, Tom Lane wrote: > Stelian Iancu writes: > > I have Postrgres 9.3 running on a Linux machine with 32GB RAM. I have a > > fairly large database (some tables with approx. 1 mil. records) and I > > have the following query: > > [ 13-way

Re: [PERFORM] Slow query (wrong index used maybe)

2014-01-27 Thread Stelian Iancu
On Mon, Jan 27, 2014, at 9:20, salah jubeh wrote: > Hello Stelian,  > Hello, > Have you tried to use func_table module?, I think it will help you to > eliminate all the joins. No, I haven't. I can have a look later, thanks. > > Regards > > -- Sent via pgsql-performance mailing list (p

[PERFORM] Slow query (wrong index used maybe)

2014-01-27 Thread Stelian Iancu
metadata_03 (cost=0.00..5869.24 rows=579474 width=0) (actual time=222.724..222.724 rows=557834 loops=1)" "Index Cond: ((name)::text = 'product_title'::text)" "Buffers: shared read=3953" it can be seen that it uses idx_product_metadata_03 which is on (name, value). Shouldn't it use index_product_metadata_02 which is on (product_id, name)? Or is there another reason why this query is so slow? I have changed some of the default settings of Postgres as follows: random_page_cost = 1.4 cpu_index_tuple_cost = 0.1 effective_cache_size = 256MB work_mem = 300MB If you need any other information, let me know. Thanks in advance! With regards, Stelian Iancu -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance