mirror of
https://github.com/MariaDB/server.git
synced 2025-10-28 01:16:31 +01:00
(Review input addressed)
After this patch, the optimizer can handle virtual column expressions
in WHERE/ON clauses. If the table has an indexed virtual column:
ALTER TABLE t1
ADD COLUMN vcol INT AS (col1+1),
ADD INDEX idx1(vcol);
and the query uses the exact virtual column expression:
SELECT * FROM t1 WHERE col1+1 <= 100
then the optimizer will be able use index idx1 for it.
This is achieved by walking the WHERE/ON clauses and replacing instances
of virtual column expression (like "col1+1" above) with virtual column's
Item_field (like "vcol"). The latter can be processed by the optimizer.
Replacement is considered (and done) only in items that are potentially
usable to the range optimizer.
|
||
|---|---|---|
| .. | ||
| examples | ||
| client_settings.h | ||
| CMakeLists.txt | ||
| emb_qcache.cc | ||
| emb_qcache.h | ||
| embedded_priv.h | ||
| lib_sql.cc | ||
| libmysql.c | ||
| libmysqld.c | ||
| libmysqld.def | ||
| libmysqld.rc | ||
| resource.h | ||