This is an automated email from the ASF dual-hosted git repository. dzamo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/drill-site.git
commit 813d2cd64d67b2f8e11ba3ba2520e7313c6980bc Author: James Turton <ja...@somecomputer.xyz> AuthorDate: Tue Feb 21 10:56:18 2023 +0200 Document DRILL-8290: Early exit from recursive file listing for LIMIT 0 queries. --- _docs/en/sql-reference/sql-commands/084-limit-clause.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/_docs/en/sql-reference/sql-commands/084-limit-clause.md b/_docs/en/sql-reference/sql-commands/084-limit-clause.md index df9f99544..160128628 100644 --- a/_docs/en/sql-reference/sql-commands/084-limit-clause.md +++ b/_docs/en/sql-reference/sql-commands/084-limit-clause.md @@ -86,6 +86,12 @@ LIMIT 0 optimizations do not work for queries with the UNION [ALL] set operator - CONVERT_TOEXTENDEDJSON - AVG (window function) +**Recursive file listing in Drill 1.21+** +Since version 1.21, Drill will exit early from recursive file listing during the planning of a query against filesystem storage if has detected a LIMIT 0 in the outermost SELECT. This optimization is aimed at queries of the following form. +``` +SELECT * FROM dfs.`huge_directory` LIMIT 0; +``` + ## Examples The following example query includes the ORDER BY and LIMIT clauses and returns the top 20 sales totals by month and state: