Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Bitmap Heap Sca...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 15352 of 17598
Post > Topic >>

Bitmap Heap Scan takes a lot of time

by mateo21@[EMAIL PROTECTED] Apr 22, 2008 at 07:36 AM

Hello,

I have a big table (around 3 600 000 entries) which stores which user
has seen which subjects in a forum.
This query is executed every time a user connects to the forum:

SELECT flg_rid
FROM prj_frm_flg
WHERE flg_mid=3 AND NOT flg_fav AND NOT flg_notif AND NOT flg_post
ORDER BY flg_rid DESC
OFFSET 999

This query very often takes a lot of time to do its job (40-60s).

I have a primary key on flg_mid and flg_sid (simultaneously) and
indexes on flg_notif, flg_post and flg_fav.

This is the result of an EXPLAIN:

"Limit  (cost=453.48..453.48 rows=1 width=4)"
"  ->  Sort  (cost=453.25..453.48 rows=94 width=4)"
"        Sort Key: flg_rid"
"        ->  Bitmap Heap Scan on prj_frm_flg  (cost=5.55..450.17
rows=94 width=4)"
"              Recheck Cond: (flg_mid = 3)"
"              Filter: ((NOT flg_fav) AND (NOT flg_notif) AND (NOT
flg_post))"
"              ->  Bitmap Index Scan on prj_frm_flg_pkey
(cost=0.00..5.53 rows=117 width=0)"
"                    Index Cond: (flg_mid = 3)"

I suppose that the problem comes from the Bitmap Heap Scan which costs
a lot, but I can't be totally sure.

Any idea on where I should be investigating ?

Thanks a lot.
Mat.
 




 3 Posts in Topic:
Bitmap Heap Scan takes a lot of time
mateo21@[EMAIL PROTECTED]  2008-04-22 07:36:27 
Re: Bitmap Heap Scan takes a lot of time
stark@[EMAIL PROTECTED]   2008-04-23 08:12:02 
Re: Bitmap Heap Scan takes a lot of time
mateo21@[EMAIL PROTECTED]  2008-04-23 07:29:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 8:33:51 CST 2008.