在包含子查询的SQL语句中,特别需要注意减少对表的查询次数。例如,优化前的查询为低效的:SELECT TAB_NAME FROM TABLES WHERE TAB_NAME = ( SELECT TAB_NAME FROM TAB_COLUMNS WHERE VERSION = 604) AND DB_VER= ( SELECT DB_VER FROM TAB_COLUMNS WHERE VERSION = 604);优化后的查询应当像这样高效地使用联合查询:SELECT TAB_NAME FROM TABLES WHERE (TAB_NAME,DB_VER) IN ( SELECT TAB_NAME,DB_VER FROM TAB_COLUMNS WHERE VERSION = 604)