Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-392

Disable creating indexes on long varchar for bit data. Long varchar column doesn't allow creating indexes already.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.0.2.2, 10.1.1.0
    • 10.1.2.1, 10.2.1.6
    • SQL
    • None
    • generic

    Description

      I guess I did not articulate my reasons for suggesting removal of index support for 'long varchar for bit data' completely.

      1) Long varchar types are not comparable... If they are not comparable, it should not be possible to use them in GROUP BY, ORDER BY or allow regular B-Tree indexes.
      2) Also, long varchar types tend to be long in size and hence the regular B-Tree mechanism is not a suitable way to index them. Dan also mentioned they become ineffective for keys longer than half a page size.

      It should not be possible to create an index on 'long varchar for bit data' datatypes. Derby currently doesn't allow creating indexes on 'long varchar' datatypes and the same should apply for it's bit data equivalent too.

      ij> create table longchar ( i int, c long varchar);
      0 rows inserted/updated/deleted
      ij> create index longIdx on longchar(c);
      ERROR X0X67: Columns of type 'LONG VARCHAR' may not be used in CREATE INDEX, ORD
      ER BY, GROUP BY, UNION, INTERSECT, EXCEPT or DISTINCT statements because compari
      sons are not supported for that type.
      ij> create table longcharBitData ( i int, c long varchar for bit data);
      0 rows inserted/updated/deleted
      ij> create index longIdx on longcharBitData(c);
      0 rows inserted/updated/deleted

      Derby also seems to allow GROUP BY and/or ORDER BY on LONG VARCHAR FOR BIT DATA types. I believe this is incorrect too.
      select c from longcharBitData group by c;
      C

      --------------------------------------------------------------------------------
      ------------------------------------------------

      0 rows selected
      ij> select c from longcharBitData group by c order by c;
      C

      --------------------------------------------------------------------------------
      ------------------------------------------------

      0 rows selected

      Attachments

        1. Derby392
          7 kB
          Satheesh E. Bandaram

        Activity

          People

            bandaram Satheesh E. Bandaram
            bandaram Satheesh E. Bandaram
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: