Re: Updates, deletes and inserts are very slow. What can I do make them bearable?

From: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
To: Tim Uckun <timuckun(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Updates, deletes and inserts are very slow. What can I do make them bearable?
Date: 2010-10-21 15:06:36
Message-ID: AANLkTikrLb=YmERTXq6P0MkRDgtQBEVsCp=PUJmX5fSC@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 20, 2010 at 7:24 PM, Tim Uckun <timuckun(at)gmail(dot)com> wrote:

> update cu
> set screenshot_file_name = tu.screenshot_file_name,
>    screenshot_content_type  = tu.screenshot_content_type,
>    screenshot_file_size = tu.screenshot_file_size,
>    screenshot_status  = tu.screenshot_status
>
> from  cu
> inner join tu on tu.cu_id = cu.id

> I am having similar problems with deletes and inserts. Trying to
> delete even a few thousand records takes forever.  The selects seem to
> be just fine.

> Where is the FAST button for postgres updates? What parameter do I
> have to set in order to update 6000 records in under an hour?

Is this a pass-through query or is it an ordinary query in Access?
If it is an an ordinary query, I'd expect that to be one cause since
MS-Access will re-write this query so that it updates a single tuple
at a time. So your single update statement becomes 6000 single tuple
update statements. This is part of MS-Access's optimistic locking
mechanism.

Also, this might be an ODBC issue (I have the sample problem on one of
my laptop that is memory constrained but I haven't taken the time to
identify the actual problem). What happens when you issue this query
directly from PSQL, does the query run much faster.

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vick Khera 2010-10-21 15:11:38 Re: full vacuum cancelation
Previous Message David Kerr 2010-10-21 15:04:40 Re: Generate a dynamic sequence within a query