Re: Update takes longer than expected

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Update takes longer than expected
Date: 2012-01-09 21:31:56
Message-ID: 4F0B5CCC.3000301@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/09/12 1:03 PM, Andy Chambers wrote:
> I have an update that takes longer than expected and wondered if
> there's an easy way to make it go faster.
>
> It's pretty simple:-
>
> create table session (
> id serial primary key,
> data text);
>
> update session
> set data = 'ipsum lorem...'
> where id = 5;
>
> The "ipsum lorem.." stuff is an encrypted session variable from a
> rails app that does tend to get quite large
>
> select avg(length(data)) from session
> => 31275
>
> We're trying to migrate the app from mysql to pg and this is one of
> the performance bottle-necks. Unfortunately it slows down every
> request by about 5 seconds. MySQL (both MyISAM and InnoDB) does this
> almost instantaneously.

is that 5 seconds for ONE of those UPDATEs, or is your webapp making
100s of those updates for every web request?

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andy Chambers 2012-01-09 22:13:06 Re: Update takes longer than expected
Previous Message Tom Lane 2012-01-09 21:30:14 Re: Update takes longer than expected