Re: [SQL] Does optimizer know about 'constant' expressions?

2000-09-17 Thread Tom Lane
Philip Warner <[EMAIL PROTECTED]> writes: > It seems that the optimizer does not know about (or calculate values of) > constant expressions when determining strategy. Datetime calculations are not considered constant-foldable. See prior discussions, eg thread "Constant propagation and similar is

[SQL] Does optimizer know about 'constant' expressions?

2000-09-17 Thread Philip Warner
It seems that the optimizer does not know about (or calculate values of) constant expressions when determining strategy. Perhaps I am doing something silly, but: select tmax from ping where pingtime > current_timestamp - interval '2 hour' order by pingtime asc limit 30; is very slo