[MDEV-371] Unique indexes for blobs Created: 2012-06-28 Updated: 2023-12-12 Resolved: 2019-02-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Create Table |
| Fix Version/s: | 10.4.3 |
| Type: | Task | Priority: | Critical |
| Reporter: | roberto spadim | Assignee: | Sachin Setiya (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | gsoc14, gsoc15, gsoc16 | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Allow a user to create unique constraints of arbitrary length. This will be done on the upper layer, in the server, not in the engine. The server will create the invisible virtual column with a hash over the to-be-unique columns. And a normal BTREE index over this column. On insert or update it'll check the index for hash collisions and, if needed, will retrieve the actual rows to compare the data. original bug report:
|
| Comments |
| Comment by Sergei Golubchik [ 2012-06-28 ] | |||||||||||||
|
yes, this was discussed for quite a while, and has a long history in MySQL bug database. | |||||||||||||
| Comment by roberto spadim [ 2012-06-28 ] | |||||||||||||
|
humm, nice =) i don´t know if it could be nice, but implementation is close to hash with any binary char field, since it´s a hash not a btree... (i´m wrong?) | |||||||||||||
| Comment by roberto spadim [ 2013-06-09 ] | |||||||||||||
|
hi sergey any idea where the patch about this try was saved? i want to see if it's easy to implement but i don't know how to start | |||||||||||||
| Comment by Sergei Golubchik [ 2013-06-10 ] | |||||||||||||
|
No, I don't. Any anyway, if I would like to do it, I would rather start | |||||||||||||
| Comment by roberto spadim [ 2013-06-10 ] | |||||||||||||
|
ok, at least a hash index/unique index could help a lot | |||||||||||||
| Comment by roberto spadim [ 2013-06-10 ] | |||||||||||||
|
this should be done in each storage engine, or index is a general "feature" of mariadb? | |||||||||||||
| Comment by Sergei Golubchik [ 2013-06-10 ] | |||||||||||||
|
in each storage engine. in particular, MyISAM and Aria almost support this already, and that "attempt" that I was referring to was exactly about making them support it fully. | |||||||||||||
| Comment by roberto spadim [ 2013-06-10 ] | |||||||||||||
|
hummm nice, in first step make myisam and aria blob index possible, innodb and others is a second step, right? | |||||||||||||
| Comment by smit hinsu [ 2014-03-17 ] | |||||||||||||
|
Hi Sergei, I am interested in working on this feature as part of GSoC. From Google search it seems that this feature is really important as many people report problem related to having BLOB/TEXT as primary key or creating index for it. I have good experience with databases but currently I am new to mariadb source code. I would appreciate if you can help me in getting started. Thanks | |||||||||||||
| Comment by Rick James [ 2022-01-27 ] | |||||||||||||
|
How does this handle COLLATION of a large TEXT field? Is there a way to "hash" while honoring complex UTF-* case and accent handling? | |||||||||||||
| Comment by Sergei Golubchik [ 2022-01-27 ] | |||||||||||||
|
It should do that automatically. But that part has a bug, though so it doesn't always work. Reported as | |||||||||||||
| Comment by Marko Mäkelä [ 2023-05-19 ] | |||||||||||||
|
For the record, the following patch should disable the
This may be useful for testing, because there are many open bugs related to indexed virtual columns, and |