hints

1:索引

 

SELECT /*+ index(e(ENTITYID)) */
 U.REALNAME, E.ENTITYNAME
  FROM TBUSER U, TBENTITY E
 WHERE U.CURRENTENTITYID = E.ENTITYID;

2:基于规则的时候,扫描表的顺序是从右向左

 

SELECT /*+ rule */ U.REALNAME, E.ENTITYNAME
  FROM TBUSER U,TBENTITY E
 WHERE U.CURRENTENTITYID = E.ENTITYID;
 

 

3:全表扫描

SELECT /*+ full(u) full(e)*/
 U.REALNAME, E.ENTITYNAME
  FROM TBUSER U, TBENTITY E
 WHERE U.CURRENTENTITYID = E.ENTITYID
   AND U.USERID = 1;
 

4:

你可能感兴趣的:(hint)