v.20.3Improvement
Make SHOW TABLES and SHOW DATABASES Support WHERE and FROM/IN Expressions
MakeSHOW TABLESandSHOW DATABASESqueries support theWHEREexpressions andFROM/IN#9076 (sundyli)
Why it matters
This feature enhances the flexibility and expressiveness ofSHOW TABLES and SHOW DATABASES commands by allowing users to filter results with WHERE conditions and specify target databases using FROM or IN. It solves the limitation of retrieving large and unfiltered lists, enabling more precise and efficient metadata querying.How to use it
Users can applyWHERE clauses to filter the output of SHOW TABLES and SHOW DATABASES queries. Additionally, they can specify the database(s) by using FROM or IN followed by one or multiple database names. For example:SHOW TABLES FROM my_database WHERE name LIKE 'prefix_%';
SHOW DATABASES WHERE name != 'default';
SHOW TABLES IN ('db1', 'db2') WHERE engine = 'MergeTree';