Feature #2629 : Ability to specify length for index segments to be indexed on char-based columns - #9132
Feature #2629 : Ability to specify length for index segments to be indexed on char-based columns#9132hvlad wants to merge 4 commits into
Conversation
…dexed on char-based columns
|
The questions for further consideration:
|
I think this is a dubious feature. How many people search BLOBs using BLOBs require slightly different indexes, such as inverted ones for FTS and the like.
Creating a unique index based on part of a key makes rather strange logical sense. |
|
Not much opinions... ok. I agree that there is almost no reasons to support indexing of BLOB's prefix. As for UNIQUE indices, the only reason I heard that sounds reasonable: when some relatively long column uses national charset (single-byte) and was converted into UTF8 (after upgrade) - and now can't be indexed due to key size limit. |
|
|
Ok. I'm going to change regular CREATE INDEX (for unique prefix-based indices only) to run duplicates check after build of b-tree - like concurrent index creation do. |
With this feature it is possible to create index on long text columns specifying max count of leading characters of string that is included into index key.
The syntax for index segment definition:
<column> [(<length>)], wherecolumnis table column name andlengthis optional maximum count of characters included into index key.The
lengthcould be set for CHAR | VARCHAR | BINARY | VARBINARY types, blobs is not supported currently.ODS changes:
RDB$INDEX_SEGMENTS.RDB$CHARACTER_LENGTHirtd_lengthin index key descriptor, seestruct Ods::irtd