Changeset: fc609ada7526 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fc609ada7526
Modified Files:
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_scenario.c
        sql/include/sql_catalog.h
        sql/server/sql_parser.y
        sql/server/sql_scan.c
        sql/storage/bat/bat_storage.c
Branch: leftmart
Log Message:

remove ordered index creation (was pushed into the gdk/heap layer)


diffs (153 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -33,7 +33,6 @@
 #include <opt_pipes.h>
 #include "clients.h"
 #include "mal_instruction.h"
-#include "orderidx.h"
 
 static int
 rel_is_table(sql_rel *rel)
@@ -518,13 +517,6 @@ alter_table(mvc *sql, char *sname, sql_t
                                        return sql_message("40000!CONSTRAINT 
PRIMARY KEY: a table can have only one PRIMARY KEY\n");
                        }
                }
-               if (t->access != TABLE_READONLY) {
-                       for (n = t->idxs.nelm; n; n = n->next) {
-                               sql_idx *i = n->data;
-                               if (i && i->type == ordered_idx)
-                                       return sql_message("40000!ORDERED 
INDEX: only READONLY tables can have an ORDERED INDEX\n");
-                       }
-               }
        }
 
        /* check for changes */
diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -445,7 +445,7 @@ SQLinitClient(Client c)
                MCpushClientInput(c, fdin, 0, "");
        }
        if (c->sqlcontext == 0) {
-               m = mvc_create(c->idx, c->idx /*0*/, SQLdebug, c->fdin, 
c->fdout);
+               m = mvc_create(c->idx, 0, SQLdebug, c->fdin, c->fdout);
                global_variables(m, "monetdb", "sys");
                if (isAdministrator(c) || strcmp(c->scenario, "msql") == 0)     
/* console should return everything */
                        m->reply_size = -1;
diff --git a/sql/include/sql_catalog.h b/sql/include/sql_catalog.h
--- a/sql/include/sql_catalog.h
+++ b/sql/include/sql_catalog.h
@@ -355,13 +355,12 @@ typedef enum idx_type {
        join_idx,
        oph_idx,                /* order preserving hash */
        no_idx,                 /* no idx, ie no storage */
-       ordered_idx,
        new_idx_types
 } idx_type;
 
 #define hash_index(t)          (t == hash_idx || t == oph_idx )
-#define idx_has_column(t)      (hash_index(t) || t == join_idx || t == 
ordered_idx)
-#define oid_index(t)           (t == join_idx || t == ordered_idx)
+#define idx_has_column(t)      (hash_index(t) || t == join_idx)
+#define oid_index(t)           (t == join_idx)
 
 typedef struct sql_idx {
        sql_base base;
diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -487,7 +487,7 @@ int yydebug=1;
 %token  START TRANSACTION READ WRITE ONLY ISOLATION LEVEL
 %token  UNCOMMITTED COMMITTED sqlREPEATABLE SERIALIZABLE DIAGNOSTICS sqlSIZE 
STORAGE
 
-%token <sval> ASYMMETRIC SYMMETRIC ORDER ORDERED BY
+%token <sval> ASYMMETRIC SYMMETRIC ORDER BY
 %token <operation> EXISTS ESCAPE HAVING sqlGROUP sqlNULL
 %token <operation> FROM FOR MATCH
 
@@ -1215,7 +1215,6 @@ index_def:
 
 opt_index_type:
      UNIQUE            { $$ = hash_idx; }
- |   ORDERED           { $$ = ordered_idx; }
  |   /* empty */       { $$ = hash_idx; }
  ;
 
diff --git a/sql/server/sql_scan.c b/sql/server/sql_scan.c
--- a/sql/server/sql_scan.c
+++ b/sql/server/sql_scan.c
@@ -156,7 +156,6 @@ scanner_init_keywords(void)
        keywords_insert("OPTION", OPTION);
        keywords_insert("OR", OR);
        keywords_insert("ORDER", ORDER);
-       keywords_insert("ORDERED", ORDERED);
        keywords_insert("OUTER", OUTER);
        keywords_insert("OVER", OVER);
        keywords_insert("PARTITION", PARTITION);
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -12,7 +12,6 @@
 #include <sql_string.h>
 #include <algebra.h>
 #include <gdk_atoms.h>
-#include <orderidx.h>
 
 #define SNAPSHOT_MINSIZE ((BUN) 1024*128)
 
@@ -1169,8 +1168,6 @@ create_idx(sql_trans *tr, sql_idx *ni)
                sql_column *c = ni->t->columns.set->h->data;
                sql_delta *d;
               
-               if (ni->type == ordered_idx) 
-                       c = ((sql_kc*)ni->columns->h->data)->c;
                if (!c->data) {
                        sql_column *oc = tr_find_column(tr->parent, c);
                        c->data = timestamp_delta(oc->data, tr->stime);
@@ -1179,19 +1176,7 @@ create_idx(sql_trans *tr, sql_idx *ni)
                /* Here we also handle indices created through alter stmts */
                /* These need to be created aligned to the existing data */
 
-               if (ni->type == ordered_idx) {
-                       Client cntxt = mal_clients+tr->stk;
-                       BAT *b = temp_descriptor(d->bid);
-                       str msg;
-
-                       /* what to do with the result msg */
-                       msg = OIDXcreateImplementation(cntxt, 
newBatType(TYPE_oid,b->ttype), b, -1);
-                       assert(msg == NULL);
-                       bat->bid = b->torderidx;
-                       (void)msg;
-                       bat_destroy(b);
-               } else
-                       bat->bid = copyBat(d->bid, type, 0);
+               bat->bid = copyBat(d->bid, type, 0);
                bat->ibid = copyBat(d->ibid, type, d->ibase);
                bat->ibase = d->ibase;
                bat->cnt = d->cnt;
@@ -1381,24 +1366,6 @@ destroy_idx(sql_trans *tr, sql_idx *i)
 
        if (i->data && i->base.allocated) {
                i->base.allocated = 0;
-               if (i->type == ordered_idx) {
-                       sql_column *c = ((sql_kc*)i->columns->h->data)->c;
-                       sql_delta *d;
-                       BAT *b;
-
-                       if (!c->data || !c->base.allocated) {
-                               int type = c->type.type->localtype;
-                               sql_column *oc = tr_find_column(tr->parent, c);
-                               sql_delta *bat = c->data = ZNEW(sql_delta), 
*obat = oc->data;
-                               ok = dup_bat(tr, c->t, obat, bat, type, 
isNew(oc), c->base.flag == TR_NEW);
-                               c->base.allocated = 1;
-                       }
-                       d = c->data;
-                       b = temp_descriptor(d->bid);
-                       b->torderidx = 0;
-                       b->batDirtydesc = TRUE;
-                       bat_destroy(b);
-               }
                        ok = destroy_bat(tr, i->data);
        }
        i->data = NULL;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to