Re: Slow query (wrong index used maybe)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stelian Iancu <stelian(at)iancu(dot)ch>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow query (wrong index used maybe)
Date: 2014-01-27 15:06:24
Message-ID: 2631.1390835184@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Stelian Iancu <stelian(at)iancu(dot)ch> 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 join joined to a 3-way join ]

Think you'll need to raise join_collapse_limit and from_collapse_limit
to get the best plan here. The planning time might hurt, though.

TBH that schema looks designed for inefficiency; you'd be better off
rethinking the design rather than hoping the planner is smart enough
to save you from it.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message salah jubeh 2014-01-27 17:20:57 Re: Slow query (wrong index used maybe)
Previous Message Stelian Iancu 2014-01-27 14:44:20 Slow query (wrong index used maybe)