dbTalk Databases Forums  

[BUGS] BUG #2208: Low performance on select

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2208: Low performance on select in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Fahri CAKIROGLU
 
Posts: n/a

Default [BUGS] BUG #2208: Low performance on select - 01-25-2006 , 11:27 AM







The following bug has been logged online:

Bug reference: 2208
Logged by: Fahri CAKIROGLU
Email address: fahri (AT) gbks (DOT) com.tr
PostgreSQL version: 8.1
Operating system: windows nt 2000
Description: Low performance on select
Details:

Consecutive selects from three different tables
causes low performance(about 1500 ms).
Same select count from two tables gives good performance(about 30 ms).
All searched keys are indexed and individual execution
of each query is very fast.

Slow query :
select * from orders where ordernum='1' order by ordernum limit 1;
select * from customers where custnum='1' order by custnum limit 1;
select * from invoice where invnum='1' order by inv limit 1;

Query with good performance :
select * from orders where ordernum='1' order by ordernum limit 1;
select * from customers where custnum='1' order by custnum limit 1;
select * from orders where ordernum='2' order by ordernum limit 1;
select * from customers where custnum='2' order by custnum limit 1;

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply With Quote
  #2  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] BUG #2208: Low performance on select - 01-25-2006 , 04:00 PM






On Wed, Jan 25, 2006 at 12:32:31PM +0000, Fahri CAKIROGLU wrote:
Quote:
Consecutive selects from three different tables
causes low performance(about 1500 ms).
Same select count from two tables gives good performance(about 30 ms).
This might be due to caching. When you query two tables all of the
pages you need might be cached, but when you query a third table
some of the pages from the other tables might be evicted from the
cache. When you query one of those tables again the pages have to
be fetched from disk.

How big are the tables in question?

Quote:
All searched keys are indexed and individual execution
of each query is very fast.
Could you post the EXPLAIN ANALYZE output of each query? Have you
tuned any of your postgresql.conf settings, in particular shared_buffers?
How much memory do you have?

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.