Re: Optimize sub query with large group by
Posted by:
Alex K
Date: March 14, 2011 07:15PM
I don't use object_id anywhere else because I don't care which object it was. I just want to make sure that only the latest person to access each object gets credit.
The innermost query sorts all the of the events by date (most recent first). The query outside that uses the group by trick to select only the first event for each object. The outermost query then counts up how many per person.
I am not sure how this would benefit from compound indexes as each query is only grouped/ordered by one column and there are no where clauses.
Should I just expect that this sort of query is bound to take several minutes when there are around 10 million events.
Subject
Views
Written By
Posted
3912
March 10, 2011 07:44PM
2199
March 13, 2011 03:52PM
1910
March 13, 2011 04:59PM
2903
March 13, 2011 11:32PM
2197
March 14, 2011 02:39AM
1664
March 14, 2011 06:31PM
Re: Optimize sub query with large group by
1546
March 14, 2011 07:15PM
1831
March 15, 2011 04:32AM
1614
March 15, 2011 08:46PM
2365
March 16, 2011 02:02AM
2272
March 16, 2011 08:57AM
1633
March 17, 2011 12:40AM
3630
March 18, 2011 10:58AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.