Constant propagation and similar issues
| От | Jules Bean |
|---|---|
| Тема | Constant propagation and similar issues |
| Дата | |
| Msg-id | 20000911132612.C4579@grommit.office.vi.net обсуждение |
| Ответы |
Re: Constant propagation and similar issues
|
| Список | pgsql-hackers |
I'm sure your aware of these limitations, but I'd thought I'd mention them just in case, and to see if you have plans to sort them out: I have a query of the form: SELECT * FROM .... WHERE (now()-date1) > 'interval 1 day'; ..i.e. all rows 'older' than 1 day. This could be efficiently processed using the index on date1, but sadly pg doesn't know this ;-( This transforms an operation which should be O(1) to O(rows).... More worryingly, when I investigated the above, I find it doesn't even use the index for SELECT * FROM .... WHERE date1 > '2000-09-11 00:00:00'::datetime - '1 hour'::interval; ...so it doesn't realise that constant-constant is constant, notwithstanding the more complex issues that now() is pseudo-constant. This could be fixed by constant folding, I guess; any plans for that? Jules
В списке pgsql-hackers по дате отправления: