select active from websites where id = (select max(id) from websites where url = 'google.com')
2 SUBQUERY websites ref url url 767 1867 Using where
如何优化此查询
如果查询的结果集不使用子查询或视图生成的字段,该字段是否仍由子查询处理?我的数据库中有很多视图,在很多地方都使用过,但是所需字段的确切集合因上下文而异。与其在每个上下文中重复类似的查询(使用适当的字段组),我还使用了可能包含每个上下文的额外字段的视图。, last_payment_date loans as l (select max(ph.rece