Details

    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:

      hi guys, i was reading about index... and i have a interesting problem...
      i need to check if a file (ok a big row... no problem...) is inside my table...
      what i´m thinking....
      create table a(b int not null default '',c longblob not null, primary key b)
      ...
      ok no problems....
      the problem is... how to know if a file, let´s sai a file of 16MB is inside my table...
      first solution is... MD5 and check each row... OK nice work....
      but could be a other nicer solution?!
      i was thinking something like:

      alter table a
      add index some_index(c) using hash;

      could this work? since it´s a hash index, i don´t see why should i use a part of c value like c (100) for example...

      could check if this is possible? today not... i tryed and it return:
      /* SQL Error (1170): Coluna BLOB 'hash_automatico' usada na especificação de chave sem o comprimento da chave */ (in portugues PT_BR)

      i think that´s all

      Attachments

        Issue Links

          Activity

            rspadim roberto spadim created issue -
            rspadim roberto spadim made changes -
            Field Original Value New Value
            Summary INDEX ON BLOBS BLOBS - allow index (at least hash index) on blobs
            rspadim roberto spadim made changes -
            Summary BLOBS - allow index (at least hash index) on blobs INDEX - BLOBS - allow index (at least hash index) on blobs
            serg Sergei Golubchik made changes -
            Fix Version/s 10.1.0 [ 12200 ]
            serg Sergei Golubchik made changes -
            Priority Trivial [ 5 ] Major [ 3 ]
            serg Sergei Golubchik made changes -
            Labels gsoc14
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            serg Sergei Golubchik made changes -
            Workflow defaullt [ 12411 ] MariaDB v2 [ 42687 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.1 [ 16100 ]
            Fix Version/s 10.1.0 [ 12200 ]
            serg Sergei Golubchik made changes -
            Labels gsoc14 gsoc14 gsoc15
            serg Sergei Golubchik made changes -
            Description hi guys, i was reading about index... and i have a interesting problem...
            i need to check if a file (ok a big row... no problem...) is inside my table...
            what i´m thinking....
            create table a(b int not null default '',c longblob not null, primary key b)
            ...
            ok no problems....
            the problem is... how to know if a file, let´s sai a file of 16MB is inside my table...
            first solution is... MD5 and check each row... OK nice work....
            but could be a other nicer solution?!
            i was thinking something like:


            alter table a
            add index some_index(c) using hash;


            could this work? since it´s a hash index, i don´t see why should i use a part of c value like c (100) for example...

            could check if this is possible? today not... i tryed and it return:
            /* SQL Error (1170): Coluna BLOB 'hash_automatico' usada na especificação de chave sem o comprimento da chave */ (in portugues PT_BR)

            i think that´s all
            Allow a user to create unique constraints of arbitrary length. Only in MyISAM (extending this to InnoDB is a separate task).

            MyISAM supports unique constraints of arbitrary length. They are used in queries like
            {code:sql}
            SELECT DISTINCT blob_column FROM some_table;
            {code}
            The server executes this query with the help of a temporary MyISAM table. And this table must be able to maintain uniqueness of all _blob_column_ values.

            *original bug report:*
            {quote}
            hi guys, i was reading about index... and i have a interesting problem...
            i need to check if a file (ok a big row... no problem...) is inside my table...
            what i´m thinking....
            create table a(b int not null default '',c longblob not null, primary key b)
            ...
            ok no problems....
            the problem is... how to know if a file, let´s sai a file of 16MB is inside my table...
            first solution is... MD5 and check each row... OK nice work....
            but could be a other nicer solution?!
            i was thinking something like:

            alter table a
            add index some_index(c) using hash;

            could this work? since it´s a hash index, i don´t see why should i use a part of c value like c (100) for example...

            could check if this is possible? today not... i tryed and it return:
            /* SQL Error (1170): Coluna BLOB 'hash_automatico' usada na especificação de chave sem o comprimento da chave */ (in portugues PT_BR)

            i think that´s all
            {quote}
            serg Sergei Golubchik made changes -
            Description Allow a user to create unique constraints of arbitrary length. Only in MyISAM (extending this to InnoDB is a separate task).

            MyISAM supports unique constraints of arbitrary length. They are used in queries like
            {code:sql}
            SELECT DISTINCT blob_column FROM some_table;
            {code}
            The server executes this query with the help of a temporary MyISAM table. And this table must be able to maintain uniqueness of all _blob_column_ values.

            *original bug report:*
            {quote}
            hi guys, i was reading about index... and i have a interesting problem...
            i need to check if a file (ok a big row... no problem...) is inside my table...
            what i´m thinking....
            create table a(b int not null default '',c longblob not null, primary key b)
            ...
            ok no problems....
            the problem is... how to know if a file, let´s sai a file of 16MB is inside my table...
            first solution is... MD5 and check each row... OK nice work....
            but could be a other nicer solution?!
            i was thinking something like:

            alter table a
            add index some_index(c) using hash;

            could this work? since it´s a hash index, i don´t see why should i use a part of c value like c (100) for example...

            could check if this is possible? today not... i tryed and it return:
            /* SQL Error (1170): Coluna BLOB 'hash_automatico' usada na especificação de chave sem o comprimento da chave */ (in portugues PT_BR)

            i think that´s all
            {quote}
            Allow a user to create unique constraints of arbitrary length. Only in MyISAM (extending this to InnoDB is a separate task).

            MyISAM supports unique constraints of arbitrary length. They are used in queries like
            {code:sql}
            SELECT DISTINCT blob_column FROM some_table;
            {code}
            The server executes this query with the help of a temporary MyISAM table. And this table must be able to maintain uniqueness of all _blob_column_ values. Internally it's implemented as an index over hash values of blobs, with the additional direct value comparison on collisions.

            So, MyISAM can do it internally, but there is no way for the end user to create such a unique constraint explicitly. The following statement
            {code:sql}
            CREATE TABLE some_table (blob_column BLOB, UNIQUE(blob_column));
            {code}
            will fail.

            This task is about giving the access to this MyISAM feature to the SQL layer, about allowing the end user to create long unique constraints explicitly.

            *original bug report:*
            {quote}
            hi guys, i was reading about index... and i have a interesting problem...
            i need to check if a file (ok a big row... no problem...) is inside my table...
            what i´m thinking....
            create table a(b int not null default '',c longblob not null, primary key b)
            ...
            ok no problems....
            the problem is... how to know if a file, let´s sai a file of 16MB is inside my table...
            first solution is... MD5 and check each row... OK nice work....
            but could be a other nicer solution?!
            i was thinking something like:

            alter table a
            add index some_index(c) using hash;

            could this work? since it´s a hash index, i don´t see why should i use a part of c value like c (100) for example...

            could check if this is possible? today not... i tryed and it return:
            /* SQL Error (1170): Coluna BLOB 'hash_automatico' usada na especificação de chave sem o comprimento da chave */ (in portugues PT_BR)

            i think that´s all
            {quote}
            serg Sergei Golubchik made changes -
            Fix Version/s 10.2.0 [ 14601 ]
            Fix Version/s 10.1 [ 16100 ]
            serg Sergei Golubchik made changes -
            Summary INDEX - BLOBS - allow index (at least hash index) on blobs Unique indexes for blobs
            ratzpo Rasmus Johansson (Inactive) made changes -
            Workflow MariaDB v2 [ 42687 ] MariaDB v3 [ 66291 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.2 [ 14601 ]
            colin Colin Charles made changes -
            Labels gsoc14 gsoc15 gsoc14 gsoc15 gsoc16
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Epic Link PT-58 [ 62150 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.3 [ 22126 ]
            Priority Minor [ 4 ] Major [ 3 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Sachin Setiya [ sachin.setiya.007 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.3 [ 22126 ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            julien.fritsch Julien Fritsch made changes -
            Epic Link PT-76 [ 68557 ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Assignee Sachin Setiya [ sachin.setiya.007 ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Sachin Setiya [ sachin.setiya.007 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Assignee Sachin Setiya [ sachin.setiya.007 ] Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Sachin Setiya [ sachin.setiya.007 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Assignee Sachin Setiya [ sachin.setiya.007 ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Sachin Setiya [ sachin.setiya.007 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Component/s Data Definition - Create Table [ 14503 ]
            Fix Version/s 10.4.3 [ 23230 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            serg Sergei Golubchik made changes -
            marko Marko Mäkelä made changes -
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Description Allow a user to create unique constraints of arbitrary length. Only in MyISAM (extending this to InnoDB is a separate task).

            MyISAM supports unique constraints of arbitrary length. They are used in queries like
            {code:sql}
            SELECT DISTINCT blob_column FROM some_table;
            {code}
            The server executes this query with the help of a temporary MyISAM table. And this table must be able to maintain uniqueness of all _blob_column_ values. Internally it's implemented as an index over hash values of blobs, with the additional direct value comparison on collisions.

            So, MyISAM can do it internally, but there is no way for the end user to create such a unique constraint explicitly. The following statement
            {code:sql}
            CREATE TABLE some_table (blob_column BLOB, UNIQUE(blob_column));
            {code}
            will fail.

            This task is about giving the access to this MyISAM feature to the SQL layer, about allowing the end user to create long unique constraints explicitly.

            *original bug report:*
            {quote}
            hi guys, i was reading about index... and i have a interesting problem...
            i need to check if a file (ok a big row... no problem...) is inside my table...
            what i´m thinking....
            create table a(b int not null default '',c longblob not null, primary key b)
            ...
            ok no problems....
            the problem is... how to know if a file, let´s sai a file of 16MB is inside my table...
            first solution is... MD5 and check each row... OK nice work....
            but could be a other nicer solution?!
            i was thinking something like:

            alter table a
            add index some_index(c) using hash;

            could this work? since it´s a hash index, i don´t see why should i use a part of c value like c (100) for example...

            could check if this is possible? today not... i tryed and it return:
            /* SQL Error (1170): Coluna BLOB 'hash_automatico' usada na especificação de chave sem o comprimento da chave */ (in portugues PT_BR)

            i think that´s all
            {quote}
            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:*
            {quote}
            hi guys, i was reading about index... and i have a interesting problem...
            i need to check if a file (ok a big row... no problem...) is inside my table...
            what i´m thinking....
            create table a(b int not null default '',c longblob not null, primary key b)
            ...
            ok no problems....
            the problem is... how to know if a file, let´s sai a file of 16MB is inside my table...
            first solution is... MD5 and check each row... OK nice work....
            but could be a other nicer solution?!
            i was thinking something like:

            alter table a
            add index some_index(c) using hash;

            could this work? since it´s a hash index, i don´t see why should i use a part of c value like c (100) for example...

            could check if this is possible? today not... i tryed and it return:
            /* SQL Error (1170): Coluna BLOB 'hash_automatico' usada na especificação de chave sem o comprimento da chave */ (in portugues PT_BR)

            i think that´s all
            {quote}
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            monty Michael Widenius made changes -
            marko Marko Mäkelä made changes -
            thiru Thirunarayanan Balathandayuthapani made changes -
            alice Alice Sherepa made changes -
            elenst Elena Stepanova made changes -
            alice Alice Sherepa made changes -
            midenok Aleksey Midenkov made changes -
            midenok Aleksey Midenkov made changes -
            midenok Aleksey Midenkov made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            midenok Aleksey Midenkov made changes -
            marko Marko Mäkelä made changes -
            bar Alexander Barkov made changes -
            marko Marko Mäkelä made changes -
            elenst Elena Stepanova made changes -
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 66291 ] MariaDB v4 [ 131946 ]
            alice Alice Sherepa made changes -
            elenst Elena Stepanova made changes -
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            marko Marko Mäkelä made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            midenok Aleksey Midenkov made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            elenst Elena Stepanova made changes -
            Roel Roel Van de Paar made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            bar Alexander Barkov made changes -
            dmonteverde Daniel Monteverde made changes -
            marko Marko Mäkelä made changes -
            alice Alice Sherepa made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            danblack Daniel Black made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            danblack Daniel Black made changes -
            marko Marko Mäkelä made changes -
            julien.fritsch Julien Fritsch made changes -
            julien.fritsch Julien Fritsch made changes -
            julien.fritsch Julien Fritsch made changes -
            julien.fritsch Julien Fritsch made changes -
            danblack Daniel Black made changes -
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Roel Roel Van de Paar made changes -
            midenok Aleksey Midenkov made changes -
            marko Marko Mäkelä made changes -
            midenok Aleksey Midenkov made changes -

            People

              sachin.setiya.007 Sachin Setiya (Inactive)
              rspadim roberto spadim
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.