Re: Why using a partial index is doing slightly more logical I/O than a normal index
От | Jeff Janes |
---|---|
Тема | Re: Why using a partial index is doing slightly more logical I/O than a normal index |
Дата | |
Msg-id | CAMkU=1yJqBB3b4Xr51eUrWWMoJsN0d6G1+8AV+RbVnPZmFgB7A@mail.gmail.com обсуждение исходный текст |
Ответ на | Why using a partial index is doing slightly more logical I/O than a normal index ("Dirschel, Steve" <steve.dirschel@thomsonreuters.com>) |
Ответы |
RE: [EXT] Re: Why using a partial index is doing slightly more logical I/O than a normal index
|
Список | pgsql-general |
Index Cond: ((workflow_id = 1070) AND ((status)::text = ANY ('{NOT_STARTED,PAUSED,PENDING,RUNNING}'::text[])))
Buffers: shared hit=33
Index Cond: ((workflow_id = 1070) AND ((status)::text = ANY ('{NOT_STARTED,PAUSED,PENDING,RUNNING}'::text[])))
Filter: (deleted_millis <= 0)
Buffers: shared hit=24
One other thing to note- when using the partial index the cost is .43 .. 15824.82. When using the other index the cost is .56 .. 15820.19. So the lower end cost (I believe the cost to find the first row) is slightly lower for the partial index but the higher end cost (I believe to find the last row) is higher for the partial index. Since there is no LIMIT clause why wouldn’t the optimizer use the lowest cost to find all rows (which in this case would be to use the non-partial index)?
В списке pgsql-general по дате отправления: