Re: Subquery in a JOIN not getting restricted? - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: Subquery in a JOIN not getting restricted?
Date
Msg-id 4EB80CAA0200002500042B3B@gw.wicourts.gov
Whole thread Raw
In response to Re: Subquery in a JOIN not getting restricted?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Subquery in a JOIN not getting restricted?  (Jay Levitt <jay.levitt@gmail.com>)
List pgsql-performance
"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

pgsql-performance by date:

Previous
From: Richard Yen
Date:
Subject: WAL partition filling up after high WAL activity
Next
From: Jay Levitt
Date:
Subject: Re: Subquery in a JOIN not getting restricted?