Unix Technical Forum

Re: Tuning, configuration for 7.3.5 on a Sun E4500

This is a discussion on Re: Tuning, configuration for 7.3.5 on a Sun E4500 within the Pgsql Performance forums, part of the PostgreSQL category; --> Tsarevich, > When running queries we are experiencing much bigger result times than > anticipated. > > Attached is ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 11:13 AM
Josh Berkus
 
Posts: n/a
Default Re: Tuning, configuration for 7.3.5 on a Sun E4500

Tsarevich,

> When running queries we are experiencing much bigger result times than
> anticipated.
>
> Attached is a copy of our postgresql.conf file and of our the table
> definitions and row counts.


Looks like you haven't run ANALYZE on the database anytime recently. Try that
and re-run.

--
Josh Berkus
Aglio Database Solutions
San Francisco

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 11:14 AM
tsarevich@gmail.com
 
Posts: n/a
Default Re: Tuning, configuration for 7.3.5 on a Sun E4500

Analyze has been run on the database quite frequently during the
course of us trying to figure out this performance issue. It is also
a task that is crontabbed nightly.


On Mon, 7 Mar 2005 09:31:06 -0800, Josh Berkus <josh@agliodbs.com> wrote:
> Tsarevich,
>
> > When running queries we are experiencing much bigger result times than
> > anticipated.
> >
> > Attached is a copy of our postgresql.conf file and of our the table
> > definitions and row counts.

>
> Looks like you haven't run ANALYZE on the database anytime recently. Try that
> and re-run.
>
> --
> Josh Berkus
> Aglio Database Solutions
> San Francisco
>


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 11:14 AM
Josh Berkus
 
Posts: n/a
Default Re: Tuning, configuration for 7.3.5 on a Sun E4500

Tsarevich,

> Analyze has been run on the database quite frequently during the
> course of us trying to figure out this performance issue. It is also
> a task that is crontabbed nightly.


Hmmm. Then you probably need to up the STATISTICS levels on the target
column, because PG is mis-estimating the number of rows returned
significantly. That's done by:

ALTER TABLE {table} ALTER COLUMN {column} SET STATISTICS {number}

Generally, I find that if mis-estimation occurs, you need to raise statistics
to at least 250.

Here's where I see the estimation issues with your EXPLAIN:

* * * * * * * * * * * * * * * * * * * * * * * * * *-> *Index Scan
using component_commercial_order_id_ix on component *(cost=0.00..3.85
rows=1 width=28) (actual time=0.17..0.18 rows=1 loops=46376)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *Index Cond:
(component.commercial_order_id = "outer".commercial_order_id)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *Filter:
((raised_dtm >= '2003-01-01 00:00:00'::timestamp without time zone)
AND (raised_dtm <= '2005-01-01 23:59:59'::timestamp without time zone)
AND ((component_type_id = 3) OR (component_type_id = 2) OR
(component_type_id = 1)))

* * * * * * * * *-> *Index Scan using communication_component_id_ix on
communication *(cost=0.00..20.90 rows=16 width=8) (actual
time=0.12..0.14 rows=1 loops=34638)
* * * * * * * * * * * *Index Cond: (component_id = $0)

So it looks like you need to raise the stats on communication.component_id and
component.commercial_order_id,raised_dtm,component _type_id. You also may
want to consider a multi-column index on the last set.

BTW, if you have any kind of data update traffic at all, ANALYZE once a day is
not adequate.

--
Josh Berkus
Aglio Database Solutions
San Francisco

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

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 03:36 AM.


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