Re: JOIN to a VIEW makes a real slow query - Mailing list pgsql-performance

From Tom Lane
Subject Re: JOIN to a VIEW makes a real slow query
Date
Msg-id 11207.1171399908@sss.pgh.pa.us
Whole thread Raw
In response to Re: JOIN to a VIEW makes a real slow query  ("Chuck D." <pgsql-performance@nullmx.com>)
Responses Re: JOIN to a VIEW makes a real slow query
List pgsql-performance
"Chuck D." <pgsql-performance@nullmx.com> writes:
> It is still using that sequence scan on the view after the APPEND for the
> us_city and world_city table.  Any reason why the view won't use the indexes
> when it is JOINed to another table but it will when the view is queried
> without a JOIN?  I should have mentioned this is v8.1.4.

8.1 isn't bright enough for that.  Should work in 8.2 though.

> Also, does anyone know why this line:
> Join Filter: ("outer".city_id = "inner"."?column1?")
> ... contains "?column1?" instead of the actual column name?

EXPLAIN can't conveniently get access to the column name.  That could
probably be improved if someone wanted to put enough effort into it.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Chuck D."
Date:
Subject: Re: JOIN to a VIEW makes a real slow query
Next
From: Mark Stosberg
Date:
Subject: Re: cube operations slower than geo_distance() on production server