Re: Slow Query, Two Large tables, Simple FKey Join
Do you mean sa.session_id is a foreign key referencing s.id? And s.id is a primary key?
Then you only need.
Select count(sa.id) from sessionaction sa where
sa.action_id=<some number>
Reason, every sa.action_id has an equivalent s.id and exactly 1 row in table s, so the join s.id=sa.action.id is redundant if all you need is to count(sa.id).
Subject
Views
Written By
Posted
5682
November 30, 2007 02:03PM
Re: Slow Query, Two Large tables, Simple FKey Join
2786
December 02, 2007 07:52AM
2635
December 02, 2007 02:00PM
1947
April 15, 2008 03:27AM
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.