Re: Merge Join chooses very slow index scan - Mailing list pgsql-performance

From Tom Lane
Subject Re: Merge Join chooses very slow index scan
Date
Msg-id 31348.1426777106@sss.pgh.pa.us
Whole thread Raw
In response to Re: Merge Join chooses very slow index scan  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
I wrote:
> [ assorted possible workarounds ]

Actually, an easy fix might be to create a 2-column index on
usagestats(type, tid).  I think the planner should be able to
use that to produce sorted output for the mergejoin, and you'd
get the best of both worlds, because the indexscan will stop
immediately when it's exhausted the rows with type = 'vehicle'.

            regards, tom lane


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Merge Join chooses very slow index scan
Next
From: Jake Magner
Date:
Subject: Re: Merge Join chooses very slow index scan