In which sequence are queries and sub-queries executed by the SQL engine?

后端 未结 5 1524
轻奢々
轻奢々 2020-11-29 06:40

Hello I made a SQL test and dubious/curious about one question:

In which sequence are queries and sub-queries executed by the SQL engine?

th

5条回答
  •  青春惊慌失措
    2020-11-29 06:58

    The SQL engine tries to optimise the order in which (sub)queries are executed. The part deciding about that is called a query optimizer. The query optimizer knows how many rows are in each table, which tables have indexes and on what fields. It uses that information to decide what part to execute first.

提交回复
热议问题