| От | Greg Stark |
|---|---|
| Тема | Re: B-tree performance improvements in 8.x |
| Дата | |
| Msg-id | 87vevp7kpv.fsf@stark.xeocode.com обсуждение исходный текст |
| Ответ на | Re: B-tree performance improvements in 8.x (Dick Kniep <dick@kniep.nl>) |
| Список | pgsql-general |
Dick Kniep <dick@kniep.nl> writes: > Does this mean that if you have a table that has many rows, and 95% of the > rows contain a NULL value for a field, that indexing will be useless, because > it will always do a tablescan? Any time you have 95% of the rows of the table with the same value you're probably going to have to think harder than usual about indexing strategies. You might consider constructing your index with "WHERE a IS NOT NULL" since otherwise 95% of your index is going to be full of records that aren't selective enough to be useful anyways. If you access your table with "WHERE a = ?" then it will undoubtedly use the index effectively. You're accessing less than 5% (presumably much less), so the index is useful. -- greg
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера