Using a window function in a view
| От | Chris Hanks |
|---|---|
| Тема | Using a window function in a view |
| Дата | |
| Msg-id | CAK7KUdBm_r9ikvEm4TFioXfQYuQVVFNAMiVV+O0Z3etBQ_H5dA@mail.gmail.com обсуждение исходный текст |
| Список | pgsql-performance |
I'm trying to create a view that uses a window function, but it seems that Postgres is apparently unable to optimize it. Here's a reproduction of my situation with 9.2.2:
---
-- This query requires a sequential scan on values, though all the data it needs could be found much more efficiently with an index scan. explain analyze select * from values_view where fkey1 = 1263;
---
Can anyone suggest a way to rewrite this query, or maybe a workaround of some kind?
Thanks, Chris
В списке pgsql-performance по дате отправления: