Search Postgresql Archives

Re: Strange behavior of function date_trunc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pavel Luzanov <p.luzanov@xxxxxxxxxxxxxx> writes:
> One thing remains unclear.
> Why, if a scalar subquery is used to materialize the function value(even 
> constant), then an inefficient index scan is chosen:

The scalar subquery prevents the planner from seeing the actual
comparison value, so it falls back to a default selectivity estimate
(notice the fairly bad rowcount estimate).  I'm a bit surprised that
that would end in choosing an indexscan over a seqscan, but that
might be a consequence of the small random_page_cost you're using.

			regards, tom lane





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux