From: Matthew Nuzum <cobalt@bearfruit.org>
To: 'scott.marlowe' <scott.marlowe@ihs.com>
To: 'ostgresql Performance' <pgsql-performance@postgresql.org>
Subject: Re: Extreme high load averages
Date: Mon, 7 Jul 2003 20:47:00 -0400
Message-ID: <001901c344ea$71391bf0$a322fea9@mattspc> (raw)
In-Reply-To: <Pine.LNX.4.33.0307071330560.4823-100000@css120.ihs.com>
> A common problem is a table like this:
>
> create table test (info text, id int8 primary key);
> insert into test values ('ted',1);
> .. a few thousand more inserts;
> vacuum full;
> analyze;
> select * from test where id=1;
>
> will result in a seq scan, always, because the 1 by itself is
> autoconverted to int4, which doesn't match int8 automatically. This
> query:
>
> select * from test where id=1::int8
>
> will cast the 1 to an int8 so the index can be used.
>
>
Hey Scott, this is a little scary because I probably have a lot of this
going on...
Is there a way to log something so that after a day or so I can go back and
look for things like this that would be good candidates for optimization?
I've got fast enough servers that currently the impact of this problem might
not be too obvious, but I suspect that after the server gets loaded up the
impact will become more of a problem.
By the way, I must say that this thread has been very useful.
Matthew Nuzum | Makers of "Elite Content Management System"
www.followers.net | View samples of Elite CMS in action
matt@followers.net | http://www.followers.net/portfolio/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: cobalt@bearfruit.org, scott.marlowe@ihs.com
Subject: Re: Extreme high load averages
In-Reply-To: <001901c344ea$71391bf0$a322fea9@mattspc>
References: <Pine.LNX.4.33.0307071330560.4823-100000@css120.ihs.com> <001901c344ea$71391bf0$a322fea9@mattspc>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox