[MDEV-4430] INDEX Optimization - Virtual Column, Dynamic Column and Index optimization Created: 2013-04-24  Updated: 2015-01-29  Resolved: 2014-01-15

Status: Closed
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: roberto spadim Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: optimizer

Issue Links:
Blocks
is blocked by MDEV-6017 Add support for Indexes on Expressions In Review

 Description   

Hi guys,
i was trying to work around MDEV-4414 with virtual column + index
but, check my problem... here the table definition:

create table t (
   linha_digitavel varchar(54) not null default '',
   tmp_substr char(37) as (SUBSTRING(linha_digitavel,1,37)) persistent,
   key linha_key (linha_digitavel),
   key tmp_substr_key (tmp_substr)
);

now the problem... i have about 50k rows in this table..

explain select * from t where tmp_substr='abc'

result => using index condition, key = 'tmp_substr_key', 1 rows

explain select * from t where SUBSTRING(linha_digitavel,1,37)='abc'

result => using where, full table scan


well i see two kinds of optimization here...
1)the MDEV-4414, where substring(?,1,?) could use index "key linha_key (linha_digitavel)"
2)the "SUBSTRING(linha_digitavel,1,37)" could be rewrite as "tmp_substr"

(2) is the MDEV feature requested here

it give DBA an oportunity to optimize closed systems, that we can't change source code, just tables...

think about a sloowww query that could be optimized with a virtual column + index + sql rewrite ! ok many job... but it's a nice feature
think about determinist functions (md5 for example) that could be optimized just replacing the "determinist_function(some_parameters)" to the virtual column, and the option to index it and make it really faster!

think about MongoDB like features... a schema less table with index on fields that may or may not exists based on LONGBLOB fields + Dynamic Column + Virtual Index, i could say goodbye mongoDB for small systems (ok the map reduce is a parallel operation with high query performace, but it's not mysql =] )


Generated at Thu Feb 08 06:56:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.