Skip site navigation (1) Skip section navigation (2)

Re: optimizing selects on time-series data in Pg

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Aditya <aditya(at)grot(dot)org>, sfpug(at)postgresql(dot)org
Subject: Re: optimizing selects on time-series data in Pg
Date: 2003-08-12 19:39:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: sfpug
> Sean, Aditya,
> > > Add backtick support for postgresql.conf:
> > >     I want to be able to do stuff like:
> > I remember reading a post that suggested using a (perl) script to generate
> > the postgresql.conf based on on the output of uname -- since we already use
> > a sh script in /usr/local/etc/rc.d, it would be trivial to incorporate
> > it...
> I'd still rather have an interactive script, which would allow for
> setting of many variables which cannot be easily set according to
> system info (sort_mem, for example).

Not sure that'd be a problem though if there was basic backtick
support.  For example, I think the best approach to go would be to
have this processor set an environment variable called PGTUNEDIR that
contains the path to the directory with PostgreSQL's "tuning scripts"
and have PGTUNEDIR unshifted onto the front of PATH that way the
following scripts are equally valid:

effective_cache_size = `$PGTUNEDIR/`
effective_cache_size = ``

With a streaming processor, it's trivial to hookup STDOUT to the newly
created static configuration file making it mind numbingly trivial to
have advanced scripts/programs that are more sophisticated than
/bin/sh create tuning values... basically, anything that's executable
and can send bits to stdout will work.  :) Since it's an outside
script, it is trivial to have the effective_cache_size script take
into account the OS via uname, the OS version (sysctl, /proc, etc),
various tuning parameters, etc.  Using this program at initdb time
could also be done in favor of at startup, but it's just as easy to
make changing that behavior a pg_ctl switch.  Anyway, I think this
plays well into tuning PostgreSQL, 'cause as I've stated...  it ain't
a black art.... I just wish PostgreSQL's cost estimates were in terms
of microseconds and not disk fetch units.  *sigh*


Sean Chittenden

In response to

sfpug by date

Next:From: Josh BerkusDate: 2003-08-13 17:34:20
Subject: Anybody know ODBC?
Previous:From: David FetterDate: 2003-08-12 19:27:40
Subject: Re: optimizing selects on time-series data in Pg

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group