← Back to team overview

maria-developers team mailing list archive

MDEV-371 Long unique Index

 

Hi Serg!

Please review the patch for Unique Index For Long (MDEV-371)
(It is in bb-10.4-blob-index branch)

Architecture:-
We will create a virtual column DB_ROW_HASH_X (X is any number which
makes this field name unique) for each long unique column which will
store hash. At the time of ha_write_row we will check for hash collusions
if we find same hash then we will retrieve the blob and then compare byte
by byte.

key_info for long unique have one extra key_part which will point to hash
field. For example unique(a,b) key  will have 3 key_parts :- a ,b DB_ROW_HASH_X
But on server layer we can just see a,b parts on storage layer we can just see
DB_ROW_HASH_X key_part.
I have created 2 function setup_table_hash and resetup_table which helps in
this transition.

If user specify length of blob then we use LEFT function to trim the value.


-- 
Regards
Sachin Setiya
Software Engineer at  MariaDB