pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: ankur_adwyze <ankur@adwyze.com>
To: pgsql-performance@postgresql.org
Subject: Re: Advise needed for a join query with a where conditional
Date: Fri, 11 Dec 2015 17:50:24 -0600
Message-ID: <566B6140.9040703@BlueTreble.com> (raw)
In-Reply-To: <1449808702878-5877097.post@n5.nabble.com>
References: <1449808702878-5877097.post@n5.nabble.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

On 12/10/15 10:38 PM, ankur_adwyze wrote:
> I have a Rails app with Postgres db. For certain reports, I have to join
> multiple tables. However, certain join queries are dog slow and I am
> wondering if I am missing any index.

My guess is that the planner is coming up with a bad estimate. Please 
post the output of EXPLAIN ANALYZE, preferably via 
http://explain.depesz.com/
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (4+ messages)  latest in thread

Message-ID: <566B6140.9040703@BlueTreble.com>
Permalink:  ../566B6140.9040703@BlueTreble.com/
Also on:    postgresql.org/message-id/566B6140.9040703@BlueTreble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: Jim.Nasby@BlueTreble.com, ankur@adwyze.com
  Subject: Re: Advise needed for a join query with a where conditional
  In-Reply-To: <566B6140.9040703@BlueTreble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox