Re: Index Organized table - hanging on selects

From: Dan <>
Date: Mon, 30 Apr 2012 10:51:59 -0700 (PDT)
Message-ID: <>

On Apr 29, 4:36 am, "Jonathan Lewis" <> wrote:
> "Dan" <> wrote in message
> | > Locks are the causing it, and it eventually
> | returns data, but even if doing a "select * from iot_table" it may
> | take 5 minutes to return rows in TOAD, when this normally is
> | instantaneous.
> Five minutes is a very long time even for all the "well-known" issues that
> might have this type of effect.
> How do you know that "locks are causing it" ?
> Next time you see this problem in a simple "select * from iot_table"  check
> what the session is waiting on (v$session_wait, v$session_wait_history, or
> snapshots on v$session_event), and pull the execution plan from memory.
> |
> | We have a large query in which one of the tables joined to is an IOT.
> | Every once in a while (maybe 5% of the time) a query will slow up to
> | the point that a 1 hour query could take 2 days.  It doesn't happen
> | all the time.  Yesterday on a particularly troublesome query I
> | recreated the IOT as a heap table with an index and the query ran as
> | expected.
> |
> This could simply be a case of a change in execution plan - you haven't
> told us anything to rule out the possibility for the join.
> Rebuilding as a heap table with PK gives you a whole new set of stats.
> | Has anyone encountered issues like this?  IOT's are suppsed to be
> | faster while reading?  Is there a bug or a problem perhaps with how
> | I'm building the table?
> Unlikely, but hard to tell since you haven't told us how you are building
> the table.
> --
> Regards
> Jonathan Lewis
> Oracle Core (Apress 2011)

Thanks for all the help on this.
I might have misled everyone when I said "locking". The point is that there are no locks happening. If there were locks I could easily address them. The query just marches along at a very slow pace but nothing seems amiss while running. It seems like a lock but it clearly isn't - especially when this is a select query, not an update or insert. I'm currently in the process of analyzing my AWR reports to see if there is anything out of place. I'm not doing a 'select *' on the table, I just used that as an example of how selects were VERY slow. If I do select * or "select * from IOT where", it is equally slow.

Per one person's advice, it may be best to abandon the IOT in general. We aren't doing full scans on it but we are stepping thru almost every record getting a particular score for everyone in our driving table. It's accessed by an index but maybe a heap table would be better...not sure yet.

My main purpose was just to see if anyone else has had (or heard of) issues with IOT's in which the table occasionally performs very slowly on a select (I know writes/updates are slow). Another person in my company experienced the same problem several months ago in which a newly created IOT was completely inaccessible, it completely hanged on select (with no locks present). Very strange...

Dan Received on Mon Apr 30 2012 - 12:51:59 CDT

Original text of this message