Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2e824a8

Browse files
committed
Rewrite choose_bitmap_and() to make it more robust in the presence of
competing alternatives for indexes to use in a bitmap scan. The formercoding took estimated selectivity as an overriding factor, causing it tosometimes choose indexes that were much slower to scan than ones with aslightly worse selectivity. It was also too narrow-minded about whichcombinations of indexes to consider ANDing. The rewrite makes it pay moreattention to index scan cost than selectivity; this seems sane since it'simpossible to have very bad selectivity with low cost, whereas the reverseisn't true. Also, we now consider each index alone, as well as addingeach index to an AND-group led by each prior index, for a total of aboutO(N^2) rather than O(N) combinations considered. This makes the resultsmuch less dependent on the exact order in which the indexes areconsidered. It's still a lot cheaper than an O(2^N) exhaustive search.A prefilter step eliminates all but the cheapest of those indexes usingthe same set of WHERE conditions, to keep the effective value of N down inscenarios where the DBA has created lots of partially-redundant indexes.
1 parent2b99411 commit2e824a8

File tree

1 file changed

+279
-150
lines changed

1 file changed

+279
-150
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp