![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
-> BitmapAnd (cost=5.62..5.62 rows=1 width=0) -> Bitmap Index Scan on pwprodukten_cat2_popuindex (cost=0.00..2.50 rows=144 width=0) Index Cond: (cat2 = 51) -> Bitmap Index Scan on pwprodukten_cat2_zichtbaar (cost=0.00..2.86 rows=144 width=0) Index Cond: ((cat2 = 51) AND (zichtbaar = true)) |
#3
| |||
| |||
|
|
So, it uses the correct index, but somehow decides to also use the other cat2_... index, which it doesn't need of course. |
#4
| |||
| |||
|
|
"Arjen" <acmmailing (AT) tweakers (DOT) net> writes: -> BitmapAnd (cost=5.62..5.62 rows=1 width=0) -> Bitmap Index Scan on pwprodukten_cat2_popuindex (cost=0.00..2.50 rows=144 width=0) Index Cond: (cat2 = 51) -> Bitmap Index Scan on pwprodukten_cat2_zichtbaar (cost=0.00..2.86 rows=144 width=0) Index Cond: ((cat2 = 51) AND (zichtbaar = true)) Hmmm ... I can reproduce that if *all* the rows in the table have zichtbaar = true (or at least the ANALYZE stats say so) ... is that the case in your data? regards, tom lane |
#5
| |||
| |||
|
|
I found another example, in case you're interested: |
#6
| |||
| |||
|
|
Arjen van der Meijden <acmmailing (AT) tweakers (DOT) net> writes: I found another example, in case you're interested: Did you apply the patch? |
#7
| |||
| |||
|
|
"Arjen" <acmmailing (AT) tweakers (DOT) net> writes: So, it uses the correct index, but somehow decides to also use the other cat2_... index, which it doesn't need of course. I've tweaked the heuristics in choose_bitmap_and to (hopefully) work a bit better in scenarios like this. Thanks for the example. regards, tom lane |
![]() |
| Thread Tools | |
| Display Modes | |
| |