Indexing a boolean
От | Kris Kiger |
---|---|
Тема | Indexing a boolean |
Дата | |
Msg-id | 3F452FEB.60902@musicrebellion.com обсуждение исходный текст |
Ответ на | modifying system table (Divya Jain <dijain@cisco.com>) |
Ответы |
Re: Indexing a boolean
Re: Indexing a boolean |
Список | pgsql-admin |
I would appreciate it if I could get some thoughts on indexing a field with only two values? For example, I have a table with a few million rows in it. All items in this table are broken up into two categories using 'T' or 'F'. It seems logical to me that an index on this field would create two logical 'buckets', so that one could say, "I want all 'T' values", or "I want all 'F' values" and merely have to look in the appropriate bucket, rather than have to perform a sequential scan through three million items every time a request is made based on 'T' or 'F'. If I were to create an index on a char(1) field that contains only values of 'T' or 'F', would the query analyzer override the use of this index? How does Postgres address this problem and what are all of your thoughts on this issue? I appreciate the help! Kris
В списке pgsql-admin по дате отправления: