Re: [HACKERS] two index bitmap scan of a big table & hash_seq_search

2011-08-20 Thread Tom Lane
"Sergey E. Koposov" writes: > Yes, it turns out that the problem was in lossify'ing the bitmap to > intensely. Yeah, I had just been coming to the same conclusion. Your table has about 134M pages, and if the planner estimate of 62M rows was right (and there's no reason it shouldn't be pretty cl

Re: [HACKERS] two index bitmap scan of a big table & hash_seq_search

2011-08-20 Thread Sergey E. Koposov
On Fri, 19 Aug 2011, Tom Lane wrote: I might be reading too much into the mention of tbm_lossify, but I wonder if the problem is repeated invocations of tbm_lossify() as the bitmap gets larger. Maybe that function needs to be more aggressive about how much information it deletes per call. Thank

Re: [HACKERS] two index bitmap scan of a big table & hash_seq_search

2011-08-19 Thread Tom Lane
"Sergey E. Koposov" writes: > But the funny thing I noticed is that the query after running a certain > amount of time doing I/O, starts to use 100%CPU and spend 99% the time in > hash_seq_search. Here is the oprofile of PG during that period: > > CPU: Intel Core/i7, speed 2.268e+06 MHz

[HACKERS] two index bitmap scan of a big table & hash_seq_search

2011-08-19 Thread Sergey E. Koposov
Hello Hackers, I've recently noticed a particularly strange behaviour of one of my simple queries: SELECT ra,dec FROM sdssdr7.photoobjall WHERE ra BETWEEN 175 and 190 AND dec BETWEEN 17 And 23 ; The table is quite large (1.1Tb, 10^9 rows, and has Btree indexes on "ra","dec" columns). The p