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 Sql > Quick select, s...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 3554 of 3799
Post > Topic >>

Quick select, slow update - help with performance problems

by gary.stainburn@[EMAIL PROTECTED] (Gary Stainburn) Jul 1, 2008 at 11:20 AM

Hi folks.

My system is slowing down, more notably over the last few weeks.
The main reason is that it's on an old slow machine, and I'm in the
process of 
sorting this.

However, I think that there are some issues within my database which I
need to 
investigate.

There seems to be some performance issues with updating the database. I
have a 
select, an insert  and an update based on the same table and condition.

The select:

select count(ud_id) 
	from used_diary 
	where ud_valet_completed is null and
		ud_valet_required < CURRENT_DATE-'7 days'::interval;

completed in about a second. The insert

insert into used_diary_log (ul_u_id, ul_ud_id, ul_changes)
	select 25, ud_id, 'Valet automatically cleared down' 
		from used_diary 
		where ud_valet_completed is null and 
			ud_valet_required < CURRENT_DATE-'7 days'::interval;

also completed in about a second. However the update 

update used_diary set 
	ud_valet_completed=now(), ud_valet_completed_by=25 
	where ud_valet_completed is null and 
		ud_valet_required < CURRENT_DATE-'7 days'::interval

is still running after approx 1 1/2 minutes.  I've noticed that other
updates 
also seem to take a long time.

Could I have any suggestions on how I could start looking into why this
is.  
Could it be the config of postgresql, issues with my schema, or something 
else?

Gary


-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000   
 

-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 3 Posts in Topic:
Quick select, slow update - help with performance problems
gary.stainburn@[EMAIL PRO  2008-07-01 11:20:41 
Re: Quick select, slow update - help with performance problems
dev@[EMAIL PROTECTED] (R  2008-07-01 12:17:16 
Re: Quick select, slow update - help with performance problems
gary.stainburn@[EMAIL PRO  2008-07-01 13:42:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Tue Dec 2 21:38:58 CST 2008.