Overview
To speed up iterative development of some SQL, it can be helpful to apply LIMIT 0
to your SELECT
statements in Dremio to execute a “dry run” of your lookup query.
Applies To
Any supported Dremio release.
Details
Adding the LIMIT 0
to any arbitrary SQL will launch a very lightweight job that returns 0 rows but executes the logical planning of the query. Using the alternative syntax of FETCH NEXT 0 ROWS ONLY
gives the same result.
This results in a job that typically completes in approximately 1 second and uses very little memory. It analyzes relations but projects an empty set, allowing validation of logical combinations, as long as no literal inputs are required.
Example:
SELECT c_customer_id FROM Samples."samples.dremio.com"."tpcds_sf1000".customer
except
select d_date_id from Samples."samples.dremio.com"."tpcds_sf1000"."date_dim"
LIMIT 0 | FETCH NEXT 0 ROWS ONLY
This generates a job with the following operators and costs:
The same SQL with LIMIT 1
instead uses the following resources: