Alvaro Herrera writes:
> CREATE TABLE foo AS SELECT a, a % 10 AS b FROM generate_series(1, 10) a;
> CREATE INDEX a_b ON foo (b);
> CREATE VIEW bar AS SELECT a, b, lead(a, 1) OVER () FROM foo;
> explain select a, b, lead(a, 1) over () from foo where b = 2;
> explain select * from bar where b =
Hi,
I've got a table and view defined like this:
CREATE TABLE foo AS SELECT a, a % 10 AS b FROM generate_series(1, 10) a;
CREATE INDEX a_b ON foo (b);
CREATE VIEW bar AS SELECT a, b, lead(a, 1) OVER () FROM foo;
Now, if I query the table directly instead of going through the view, a
WHERE co