Unix Technical Forum

BUG #2342: Extremely bad performance on a specific query, compared to 7.4

This is a discussion on BUG #2342: Extremely bad performance on a specific query, compared to 7.4 within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2342 Logged by: Mattias Kregert Email address: mattias@kregert.se PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:50 AM
Mattias Kregert
 
Posts: n/a
Default BUG #2342: Extremely bad performance on a specific query, compared to 7.4


The following bug has been logged online:

Bug reference: 2342
Logged by: Mattias Kregert
Email address: mattias@kregert.se
PostgreSQL version: 8.1
Operating system: Linux
Description: Extremely bad performance on a specific query, compared
to 7.4
Details:

Query:
------
SELECT id FROM pics WHERE
(file='3a76h3gd873kmn7ckd76' AND archived IS NULL) OR
(file='jj38kmc983lmn2547cx0' AND archived IS NULL) OR
....
[something like 500 lines]

Table info:
-----------
The pics table has 200K rows.
Index#1 on id.
Index#2 on file.
Analyze done.

Problem:
--------
With pg7.4, on an antique pII-233mhz, this query takes approximately 0.5
seconds.

With pg8.1, on a Cel-2.67ghz, the same query takes around 70 seconds @ 99%
cpu usage.

I would expect it to take less than .05 seconds, since the cpu is 10 times
faster, the disks are faster, more memory and so on... So what makes pg8.1
1400 times slower than pg7.4?

According to 'explain' it is doing a Bitmap Index Scan for every line in the
query. Is there a way to turn off this new dynamic bitmap feature, or tune
it in some way?

/M

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:51 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #2342: Extremely bad performance on a specific query, compared to 7.4

"Mattias Kregert" <mattias@kregert.se> writes:
> SELECT id FROM pics WHERE
> (file='3a76h3gd873kmn7ckd76' AND archived IS NULL) OR
> (file='jj38kmc983lmn2547cx0' AND archived IS NULL) OR
> ...


Could we see EXPLAIN ANALYZE results for this query from both the 7.4
and 8.1 systems? Since you haven't even told us what indexes are
available on the table, there's not a lot we can do with this report.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:17 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com