Re: long running select min(timestamp) query
Date: Mon, 28 Jan 2008 16:17:52 -0800 (PST)
Message-ID: <5d867996-2db3-4376-bd3b-ec63e461b1e9@d21g2000prf.googlegroups.com>
On Jan 28, 7:40 am, "bobdu..._at_gmail.com" <bobdu..._at_gmail.com> wrote:
> Hi,
>
> I have a basic event table in my 10g database, primary integer key,
> and a nonnull timestamp "eventdate" field. When executing the
> following command:
>
> select min(eventdate) from events;
>
> It can occasionally take a VERY long time. There is a standard btree
> index on "eventdate", and roughly 20 other columns, a few of which
> also have basic btree indexes.
Well, I'm guessing that your 20 column index is just not the best one for your min. What happens if you make a btree index on just that eventdate column? It's been my experience that any table with more than a few columns in an index isn't properly normalized.
There might be bug/patch issues, too. timestamp is relatively new, and you are using an unpatched base release.
How are you loading this table? What is the exact definition of the index?
jg
-- @home.com is bogus. http://www.spacefem.com/hydrox/Received on Mon Jan 28 2008 - 18:17:52 CST