Lets say I have two columns, A and B. They are each indexed seperately. If I do a query like: SELECT * FROM table WHERE A = 1 AND B = 2; postgres can only use one index. I assume that postgres uses the index data to narrow down pages in the table to visit when doing its search. Then it goes through and filters on the second condition. My question: why can't it go through the first index, get a list of pages in the table, then go through the second index, union the result with the results from first index, and then go into the table?
Joseph Shraibman <jks@selectacast.net> writes:
> My question: why can't it go through the first index, get a list of
> pages in the table, then go through the second index, union the result
> with the results from first index, and then go into the table?
See TODO list ...
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера