Tomas Vondra <tomas.vondra@xxxxxxxxxxxxxxx> writes: > On 16.3.2015 19:50, Marc Watson wrote: >> I hope someone can help me with a problem I'm having when joining a >> view with a table. The view is somewhat involved, but I can provide the >> details if necessary > First, get rid of the ORDER BY clauses in the subselects - it's > completely pointless, and might prevent proper optimization (e.g. > replacing the IN() with optimized joins. I'm suspicious that the cause may be an ORDER BY in the view. It's hard to tell when we've not seen the view definition, but I see that both plans we've been shown are going to produce output sorted by actor.id. Maybe that's happenstance, or maybe not. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general