Re: Slow query (wrong index used maybe) - Mailing list pgsql-performance

From Tom Lane
Subject Re: Slow query (wrong index used maybe)
Date
Msg-id 2631.1390835184@sss.pgh.pa.us
Whole thread Raw
In response to Slow query (wrong index used maybe)  (Stelian Iancu <stelian@iancu.ch>)
Responses Re: Slow query (wrong index used maybe)
List pgsql-performance
Stelian Iancu <stelian@iancu.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


pgsql-performance by date:

Previous
From: Stelian Iancu
Date:
Subject: Slow query (wrong index used maybe)
Next
From: salah jubeh
Date:
Subject: Re: Slow query (wrong index used maybe)