How do you interpret a query's explain plan?

后端 未结 11 1708
鱼传尺愫
鱼传尺愫 2020-12-02 05:12

When attempting to understand how a SQL statement is executing, it is sometimes recommended to look at the explain plan. What is the process one should go through in interpr

11条回答
  •  青春惊慌失措
    2020-12-02 05:38

    Rules of Thumb

    (you probably want to read up on the details too:

    • Oracle Docs
    • ASKTOM
    • SQL Server Docs
      )

    Bad

    Table Scans of Several Large Tables

    Good

    Using a unique index
    Index includes all required fields

    Most Common Win

    In about 90% of performance problems I have seen, the easiest win is to break up a query with lots (4 or more) of tables into 2 smaller queries and a temporary table.

提交回复
热议问题