In the event that the size of the tables do not make it obvious which one is the fact table, the 
FACT hint allows one to specify this directly. Star query optimization or star query 
transformation will take place on this basis. 
SELECT /*+ FACT (transactions) */ 
 b.office_name, t.time_id, SUM(f.number_shares) 
FROM transactions f, stocks s, brokerages b, time t 
WHERE f.stock_id = s.stock_id 
AND f.brokerage_id = b.brokerage_id 
AND f.time_id = t.time_id 
AND b.region = 'Central' 
AND t.season = 'Spring' 
AND s.industry = 'Banking' 
GROUP BY b.office_name, t.time_id;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: