Search Postgresql Archives

Stats for indexes on expressions

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

 



Hello,

I am trying to understand how the cost for a query involving indexes on expressions is calculated. How is the statistics on the _expression_ maintained? For example Postgres documentation on 'Indexes on Expressions' mentions the following example:

CREATE INDEX people_names ON people ((first_name || ' ' || last_name));
SELECT * FROM people WHERE (first_name || ' ' || last_name) = 'John Smith';

The index is created on an _expression_ involving first name and last name. My confusion is basically around:

(1) When using this index how will the query planner get the stats on this _expression_? 
(2) Whenever an index on an _expression_ is defined like this, should we rebuild the stats? 

Thanks,

Shantanu




[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 Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux