functional indexes and their costs - Mailing list pgsql-general

From Adam
Subject functional indexes and their costs
Date
Msg-id 1047591402.26998.27.camel@ahansen.ofsloans.com
Whole thread Raw
Responses Re: functional indexes and their costs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
refer to the following 2 querys which were run after a vacuum analyze...

=# EXPLAIN SELECT * FROM sales_personal WHERE last_name='hansen';
NOTICE:  QUERY PLAN:

Index Scan using sales_personal_last_name_index on sales_personal
(cost=0.00..280.68 rows=81 width=618)

EXPLAIN
=#EXPLAIN SELECT * FROM sales_personal WHERE lower(last_name)='hansen';
NOTICE:  QUERY PLAN:

Index Scan using test_lower_idx on sales_personal  (cost=0.00..5827.83
rows=1642 width=618)

EXPLAIN

anyone have any idea why the cost of using the functional index is so
much greater than the cost of using the regular (unfunctioned) index on
the same column?





pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: unlock rows
Next
From: Petre Scheie
Date:
Subject: Re: PL/Java (was: stored procedures)