Re: Updates, deletes and inserts are very slow. What can I do make them bearable? - Mailing list pgsql-general

From Richard Broersma
Subject Re: Updates, deletes and inserts are very slow. What can I do make them bearable?
Date
Msg-id AANLkTikrLb=YmERTXq6P0MkRDgtQBEVsCp=PUJmX5fSC@mail.gmail.com
Whole thread Raw
In response to Updates, deletes and inserts are very slow. What can I do make them bearable?  (Tim Uckun <timuckun@gmail.com>)
List pgsql-general
On Wed, Oct 20, 2010 at 7:24 PM, Tim Uckun <timuckun@gmail.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

pgsql-general by date:

Previous
From: David Kerr
Date:
Subject: Re: Generate a dynamic sequence within a query
Next
From: "A.M."
Date:
Subject: Re: Custom cache implemented in a postgresql C function