Re: Subquery in a JOIN not getting restricted?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jay Levitt" <jay(dot)levitt(at)gmail(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Subquery in a JOIN not getting restricted?
Date: 2011-11-07 22:51:54
Message-ID: 4EB80CAA0200002500042B3B@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jay Levitt 2011-11-07 23:19:32 Re: Subquery in a JOIN not getting restricted?
Previous Message Richard Yen 2011-11-07 22:18:46 WAL partition filling up after high WAL activity