Re: Looking for tips

From: Oliver Crosby <ryusei(at)gmail(dot)com>
To: PFC <lists(at)boutiquenumerique(dot)com>
Cc: Sven Willenberger <sven(at)dmv(dot)com>, Dawid Kuroczko <qnex42(at)gmail(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, jd(at)commandprompt(dot)com, pgsql-performance(at)postgresql(dot)org
Subject: Re: Looking for tips
Date: 2005-07-20 01:50:18
Message-ID: 1efd553a050719185059de2581@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Sorry for the lack of specifics...

We have a file generated as a list of events, one per line. Suppose
lines 1,2,3,5,7,11,etc were related, then the last one would specify
that it's the last event. Gradually this gets assembled by a perl
script and when the last event is encountered, it gets inserted into
the db. For a given table, let's say it's of the form (a,b,c) where
'a' is a pkey, 'b' is indexed, and 'c' is other related information.
The most common 'b' values are cached locally with the perl script to
save us having to query the db. So what we end up having is:

if 'b' exists in cache, use cached 'a' value and continue
else if 'b' exists in the db, use the associated 'a' value and continue
else add a new line with 'b', return the new 'a' and continue

The local cache was a huge time saver with mysql. I've tried making a
plpgsql function that handles everything in one step on the db side,
but it didn't show any improvement. Time permitting, I'll try some new
approaches with changing the scripts and queries, though right now I
was just hoping to tune postgresql.conf to work better with the
hardware available.

Thanks to everyone for your help. Very much appreciated.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Creager 2005-07-20 04:49:08 Re: Huge performance problem between 7.4.1 and 8.0.3 - CS
Previous Message Luke Lonergan 2005-07-20 00:39:33 Re: COPY FROM performance improvements