Newsgroups: comp.databases.oracle.server
From: Charles Hooper <hooperc2...@yahoo.com>
Date: Tue, 29 Jan 2008 15:17:10 -0800 (PST)
Local: Tues, Jan 29 2008 6:17 pm
Subject: Re: long running select min(timestamp) query
On Jan 29, 5:54 pm, joel garry <joel-ga...@home.com> wrote:
> On Jan 29, 1:36 pm, "bobdu...@gmail.com" <bobdu...@gmail.com> wrote: In addition to looking at the wait events, you may also want to > > On Jan 29, 2:53 pm, joel garry <joel-ga...@home.com> wrote: > > > On Jan 29, 6:39 am, "bobdu...@gmail.com" <bobdu...@gmail.com> wrote: > > > > On Jan 28, 7:17 pm, joel garry <joel-ga...@home.com> wrote: > > > > > On Jan 28, 7:40 am, "bobdu...@gmail.com" <bobdu...@gmail.com> wrote: > > > > > > Hi, > > > > > > I have a basic event table in my 10g database, primary integer key, > > > > > > select min(eventdate) from events; > > > > > > It can occasionally take a VERY long time. There is a standard btree > > > > > Well, I'm guessing that your 20 column index is just not the best one > > > > > There might be bug/patch issues, too. timestamp is relatively new, > > > > > How are you loading this table? What is the exact definition of the > > > > > jg > > > > All the indexes on the table only span ONE column, not all! Here's > > > Sorry 'bout that! > > > Charles has bought up a good point about concurrency, and it makes me > > > I'm also idly wondering if delayed block cleanout can be involved > > > > CREATE TABLE "MYSCHEMA"."EVENTS" > > > > CREATE INDEX "MYSCHEMA"."EVENTS_EVENTDATE" ON > > > > Then there's a bunch of other indexes, 8 total, with the one above and > > > > CREATE INDEX "MYSCHEMA"."EVENTS_ACTION" ON > > > jg > > I definitely have done some large scale deletes. When i say > Sure, when all else fails blame the hardware! :-) (There are people > I think we've ruled out the delayed block cleanout issue if it hasn't > So: http://richardfoote.wordpress.com/2007/12/11/index-internals-rebuildi... > Also, please post your top waits, and continue on the path Charles has > > I just tried to get more stats via the following call, and then > > SQL> exec > > PL/SQL procedure successfully completed. > > SQL> analyze table events list chained rows; > > Table analyzed. > > SQL> select owner_name, table_name, count(*) > > no rows selected > jg further investigate session level statistics to see if undo blocks are being applied to produce a consistent view of the data. For example, before running your query, execute the following to obtain a beginning snapshot of the statistics: SELECT SN.NAME, MS.VALUE FROM V$STATNAME SN, V$MYSTAT MS WHERE SN.NAME IN ( 'consistent changes', 'data blocks consistent reads - undo records applied', 'consistent gets', 'cleanouts and rollbacks - consistent read gets') AND SN.STATISTIC#=MS.STATISTIC#; Then, execute your query: Then execute the statistics query again: Finally, manually subtract the beginning values from the ending For example: --- NAME VALUE The 10046 trace for the query that I executed showed 8 consistent CONSISTENT GETS: Requests for a Block Consistent Read - Statistic CONSISTENT CHANGES: Undo Records Applied to Provide Consistent Read - DATA BLOCKS CONSISTENT READS - UNDO RECORDS APPLIED: Undo Applied to CLEANOUTS AND ROLLBACKS - CONSISTENT READ GETS: Undo/Block Cleanout Charles Hooper You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||