gpt4 book ai didi

sql - Oracle EXPLAIN PLAN FOR 不返回任何内容

转载 作者:行者123 更新时间:2023-12-05 01:42:41 24 4
gpt4 key购买 nike

我在 Oracle 数据库上运行以下查询:

EXPLAIN PLAN FOR
SELECT *
FROM table_name

但是,它没有返回任何数据。当我删除 EXPLAIN PLAN FOR 子句时,查询确实按预期运行。感谢您的帮助!

如果相关,我将通过 Teradata 和 Jupyter IPython 笔记本访问数据库。

最佳答案

来自 Using EXPLAIN PLAN :

The PLAN_TABLE is automatically created as a global temporary table to hold the output of an EXPLAIN PLAN statement for all users. PLAN_TABLE is the default sample output table into which the EXPLAIN PLAN statement inserts rows describing execution plans

EXPLAIN PLAN FOR  SELECT last_name FROM employees;

This explains the plan into the PLAN_TABLE table. You can then select the execution plan from PLAN_TABLE.

Displaying PLAN_TABLE Output

  • UTLXPLS.SQL
  • UTLXPLP.SQL
  • DBMS_XPLAN.DISPLAY table function

我建议使用:

EXPLAIN PLAN FOR SELECT * FROM table_name;

SELECT * FROM TABLE(dbms_xplan.display);

关于sql - Oracle EXPLAIN PLAN FOR 不返回任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51252871/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com