[MDEV-5800] indexes on virtual (not materialized) columns Created: 2014-03-06 Updated: 2024-01-30 Resolved: 2016-12-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Virtual Columns |
| Fix Version/s: | 10.2.3 |
| Type: | Task | Priority: | Blocker |
| Reporter: | Sergei Golubchik | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 7 |
| Labels: | Compatibility, gsoc14, gsoc15 | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Epic Link: | Oracle Compatibility | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | 10.2.0-1, 10.2.0-2, 10.2.0-4, 10.2.0-6, 10.2.0-7, 10.2.0-8, 10.2.0-9, 10.2.0-10, 10.2.0-11, 10.2.2-4, 10.2.3-2, 10.0.28, 10.2.4-1, 10.2.4-4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Currently to have a index on a virtual column, one has to materialized it. To support indexes on fully virtual columns, a storage engine must call back into the server to calculate the value of the virtual column. |
| Comments |
| Comment by Richa Sehgal [ 2015-03-13 ] | |||
|
Hi, I am Richa Sehgal currently pursuing Master’s at University of Illinois Urbana Champaign, USA. I did my undergraduate from Indian Institute of Technology Delhi (IIT-Delhi). I would like to take this up as my GSoC project. Materialization gives us two things: My initial thoughts on this project are the following: create virtual_index <name> on <column_name> <expression> What this would do would run a regular query which evaluates expressions (like in WHERE clause) and the feed the result into the indexer. This index can then be stored in the regular fashion. | |||
| Comment by Sergei Golubchik [ 2015-03-13 ] | |||
| Comment by Axel Schwenke [ 2015-10-19 ] | |||
|
From a user right now on #maria: an index on a virtual column should be used not only when the virtual column is referenced by name, but also when the expression defining that column is used. That would mean that an index on a virtual column is equivalent to a functional index (MDEV-6017) on the expression defining that column. Example:
The expectation is that both queries use the index on the virtual column. The first because the virtual column is referenced by name, the second because the virtual column is referenced by the defining expression. The index on c3 would behave like a functional index on (c1+c2) |