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
3854
March 10, 2011 07:44PM
2165
March 13, 2011 03:52PM
1870
March 13, 2011 04:59PM
2846
March 13, 2011 11:32PM
2157
March 14, 2011 02:39AM
1623
March 14, 2011 06:31PM
Re: Optimize sub query with large group by
1510
March 14, 2011 07:15PM
1772
March 15, 2011 04:32AM
1579
March 15, 2011 08:46PM
2280
March 16, 2011 02:02AM
2235
March 16, 2011 08:57AM
1586
March 17, 2011 12:40AM
3580
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.