How does Oracle Text perform Index lookup?
13095Jun 3 2005 — edited Jun 7 2005I am just wondering how Oracle Text performs normal Index lookup to satisfy a query. I understand that it uses the $I table to look for docids for a given Token (search word), then goes to the $R table to get the rowid for returned docids. However, when I did a trace of my query, the following are the steps I see.
1. SELECT /*+ INDEX(i) */ TOKEN_FIRST,TOKEN_LAST,TOKEN_COUNT,ROWID
FROM DR$SEARCH_INDEX$I i WHERE TOKEN_TEXT = :word AND TOKEN_TYPE = :wtype ORDER BY TOKEN_TEXT, TOKEN_TYPE, TOKEN_FIRST
2. SELECT TOKEN_INFO FROM
DR$SEARCH_INDEX$I WHERE ROWID = :rid
3. select data from DR$SEARCH_INDEX$I
where row_no = :row_no
My question is, why is there a 2nd SELECT on the $I table (step 2). Why not include the TOKEN_INFO in the first SELECT (step 1).
Thanks,
Jojo