This join typeis like ref, but with the addition that MySQL does an extra search for rowsthat contain NULL values. This join type optimization is used most often inresolving subqueries. In the following examples, MySQL can use a ref_or_nulljoin to process ref_table: SELECT * FROM ref_tab...
Examples Note For these examples, the sample output might vary depending on Amazon Redshift configuration. The following example returns the query plan for a query that selects the EVENTID, EVENTNAME, VENUEID, and VENUENAME from the EVENT and VENUE tables: ...
As a result, the query performance is poor. Keys such as the join key or group by key that are involved in expressions: If you use a CAST function to convert data types, the local join feature is not used. In this case, redistribution occurs. Examples: Example 1: Join two tables....
unionM,N: The row refers to the union of the rows with id values of M and N. derivedN: The row refers to the derived table result for the row with an id value of N. A derived table may result, for example, from a subquery in the FROM clause. subqueryN: The row refers to the...
Examples Explain an SQL query and store the obtained execution plan in the test table. /* Create a table named test. */ obclient> CREATE TABLE test (statement_id VARCHAR(30), plan_id INT, gmt_create TIMESTAMP, remarks VARCHAR(4000), operator VARCHAR(255), options VARCHAR(255), object_...
you may be able toimprove the performance of your query by examining the WHERE clause to checkwhether it refers to some column or columns that would be suitable forindexing. If so, create an appropriate index and check the query with EXPLAINagain. See Section 12.1.7, “ALTER TABLE Syntax”...
(AWR) SQL Tuning Set (STS) SQL Plan Baseline (SPM) Using the EXPLAIN PLAN Command and the DBMS_XPLAN.DISPLAY Function The following examples illustrate how to generate and display an execution plan for our original SQL statement using the different functions provided in the DBMS_...
The order of execution in a visual explain diagram is bottom to top and left to right. The diagram examples that follow provide an overview of the graphic, textual, and informational conventions used to represent aspects of the visual explain plans. For specific information, see: ...
This join type is like ref, but with the addition that MySQL does an extra search for rows that contain NULL values. This join type optimization is used most often in resolving subqueries. In the following examples, MySQL can use a ref_or_null join to process ref_table: SELECT * FROM...
The output of EXPLAIN ANALYZE for this query shows that the query scans all the rows but is still limited to only two columns, which shows that the filter predicate doesn’t work when the TRIM function is applied. We’ve seen from the preceding examples that the Athena...