STAR Hint


One can include the STAR hint within the query. This requests that the optimizer perform 
standard star query optimization using a nested loops operation. This is the default when the 
circumstances to encourage star transformation do not exist.

SQL> CREATE BITMAP INDEX time_bitmap 
 ON transactions (time_id); 
Index created. 

SQL> CREATE BITMAP INDEX stocks_bitmap 
 ON transactions (stock_id); 
Index created. 

SQL> CREATE BITMAP INDEX brokerages_bitmap 
 ON transactions (brokerage_id);

SELECT /*+ STAR */ 
 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: