indexing - Indexes in Postgresql -
we have table users (userid, username, category, pincode) in postgresql
if create indexes like:
- create index category_idx(category) on users;
- create index category_pincode_idx(category, pincode) on users;
and query table users as:
select * users category = somevalue;
which index applied?
executing following statement reveal index execution planner pick depending on current data set:
explain select * users category = somevalue;
please advised planner might chose not use index if amount of data not warrant use of index because full table scan on few rows might quicker.
Comments
Post a Comment