From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Jay Levitt <jay.levitt@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Subquery in a JOIN not getting restricted?
Date: Mon, 07 Nov 2011 16:51:54 -0600
Message-ID: <4EB80CAA0200002500042B3B@gw.wicourts.gov> (raw)
In-Reply-To: <4EB7FEFD0200002500042B1C@gw.wicourts.gov>
References: <4EB84CB4.2010102@gmail.com>
<4EB7FEFD0200002500042B1C@gw.wicourts.gov>
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> wrote:
> If I had made the scores table wider, it might have gone from the
> user table to scores on the index.
Bah. I just forgot to put an index on scores.user_id. With that
index available it did what you were probably expecting -- seq scan
on questions, nested loop index scan on users, nested loop index
scan on scores.
You weren't running you test with just a few rows in each table and
expecting the same plan to be generated as for tables with a lot of
rows, were you?
-Kevin
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: Kevin.Grittner@wicourts.gov, jay.levitt@gmail.com
Subject: Re: Subquery in a JOIN not getting restricted?
In-Reply-To: <4EB80CAA0200002500042B3B@gw.wicourts.gov>
* 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