Changeset: f924a3b2eb35 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f924a3b2eb35 Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/Tests/SQL-dump.stable.out clients/Tests/SQL-dump.stable.out.int128 clients/Tests/exports.stable.out gdk/gdk.h gdk/gdk_align.c gdk/gdk_bbp.c gdk/gdk_private.h gdk/gdk_search.c gdk/gdk_select.c monetdb5/modules/mal/orderidx.c monetdb5/modules/mal/orderidx.h monetdb5/modules/mal/orderidx.mal sql/backends/monet5/sql.c sql/storage/bat/bat_storage.c sql/test/orderidx/Tests/simpletable.stable.out sql/test/orderidx/Tests/smalltable.stable.out Branch: leftmart Log Message:
Implemented ordered index as a heap. diffs (truncated from 4112 to 300 lines): diff --git a/clients/Tests/MAL-signatures.stable.out b/clients/Tests/MAL-signatures.stable.out --- a/clients/Tests/MAL-signatures.stable.out +++ b/clients/Tests/MAL-signatures.stable.out @@ -31213,10 +31213,6 @@ command bat.delete(b:bat[:oid,:any_1],sr address BKCdelete_bat_bun; comment Delete from the first BAT all BUNs with a corresponding BUN in the second. -pattern bat.getorderidx(bv:bat[:oid,:any_1]):bat[:oid,:oid] -address OIDXgetorderidx; -comment Return the order index oid bat if exists (not safe, for debug) - command bat.getName(b:bat[:oid,:any_1]):str address BKCgetBBPname; comment Gives back the logical name of a BAT. @@ -40515,6 +40511,10 @@ pattern sql.copy_rejects_clear():void address COPYrejects_clear; pattern sql.copy_rejects() (rowid:bat[:oid,:lng],fldid:bat[:oid,:int],msg:bat[:oid,:str],inp:bat[:oid,:str]) address COPYrejects; +pattern sql.createorderindex(sch:str,tbl:str,col:str):void +address sql_createorderindex; +comment Instantiate the order index on a column + pattern sql.copy_from(t:ptr,sep:str,rsep:str,ssep:str,ns:str,fname:str,nr:lng,offset:lng,locked:int,best:int):bat[:oid,:any]... address mvc_import_table_wrap; comment Import a table from bstream s with the given tuple and seperators (sep/rsep) @@ -40631,6 +40631,10 @@ command sql.dec_round(v:bte,r:bte):bte address bte_dec_round_wrap; comment round off the value v to nearests multiple of r +pattern sql.droporderindex(sch:str,tbl:str,col:str):void +address sql_droporderindex; +comment Drop the order index on a column + pattern sql.dump_trace() (event:bat[:oid,:int],clk:bat[:oid,:str],pc:bat[:oid,:str],thread:bat[:oid,:int],ticks:bat[:oid,:lng],rssMB:bat[:oid,:lng],vmMB:bat[:oid,:lng],reads:bat[:oid,:lng],writes:bat[:oid,:lng],minflt:bat[:oid,:lng],majflt:bat[:oid,:lng],nvcsw:bat[:oid,:lng],stmt:bat[:oid,:str]) address dump_trace; comment dump the trace statistics diff --git a/clients/Tests/MAL-signatures.stable.out.int128 b/clients/Tests/MAL-signatures.stable.out.int128 --- a/clients/Tests/MAL-signatures.stable.out.int128 +++ b/clients/Tests/MAL-signatures.stable.out.int128 @@ -40254,10 +40254,6 @@ command bat.delete(b:bat[:oid,:any_1],sr address BKCdelete_bat_bun; comment Delete from the first BAT all BUNs with a corresponding BUN in the second. -pattern bat.getorderidx(bv:bat[:oid,:any_1]):bat[:oid,:oid] -address OIDXgetorderidx; -comment Return the order index oid bat if exists (not safe, for debug) - command bat.getName(b:bat[:oid,:any_1]):str address BKCgetBBPname; comment Gives back the logical name of a BAT. @@ -40286,6 +40282,10 @@ command bat.getSize(b:bat[:oid,:any_1]): address BKCgetSize; comment Calculate the actual size of the BAT descriptor, heaps, hashes and imprint indices in bytes rounded to the memory page size (see bbp.getPageSize()). +pattern bat.hasorderidx(bv:bat[:oid,:any_1]):bit +address OIDXhasorderidx; +comment Return true if order index exists + command bat.imprintsize(b:bat[:oid,:hge]):lng address CMDBATimprintsize; command bat.imprints(b:bat[:oid,:hge]):void @@ -51446,6 +51446,10 @@ pattern sql.copy_rejects_clear():void address COPYrejects_clear; pattern sql.copy_rejects() (rowid:bat[:oid,:lng],fldid:bat[:oid,:int],msg:bat[:oid,:str],inp:bat[:oid,:str]) address COPYrejects; +pattern sql.createorderindex(sch:str,tbl:str,col:str):void +address sql_createorderindex; +comment Instantiate the order index on a column + pattern sql.copy_from(t:ptr,sep:str,rsep:str,ssep:str,ns:str,fname:str,nr:lng,offset:lng,locked:int,best:int):bat[:oid,:any]... address mvc_import_table_wrap; comment Import a table from bstream s with the given tuple and seperators (sep/rsep) @@ -51566,6 +51570,10 @@ command sql.dec_round(v:bte,r:bte):bte address bte_dec_round_wrap; comment round off the value v to nearests multiple of r +pattern sql.droporderindex(sch:str,tbl:str,col:str):void +address sql_droporderindex; +comment Drop the order index on a column + pattern sql.dump_trace() (event:bat[:oid,:int],clk:bat[:oid,:str],pc:bat[:oid,:str],thread:bat[:oid,:int],ticks:bat[:oid,:lng],rssMB:bat[:oid,:lng],vmMB:bat[:oid,:lng],reads:bat[:oid,:lng],writes:bat[:oid,:lng],minflt:bat[:oid,:lng],majflt:bat[:oid,:lng],nvcsw:bat[:oid,:lng],stmt:bat[:oid,:str]) address dump_trace; comment dump the trace statistics diff --git a/clients/Tests/SQL-dump.stable.out b/clients/Tests/SQL-dump.stable.out --- a/clients/Tests/SQL-dump.stable.out +++ b/clients/Tests/SQL-dump.stable.out @@ -122,6 +122,7 @@ SYSTEM FUNCTION sys.columnsize SYSTEM FUNCTION sys.contains SYSTEM FUNCTION sys.convexhull SYSTEM FUNCTION sys.corr +SYSTEM FUNCTION sys.createorderindex SYSTEM FUNCTION sys.crosses SYSTEM FUNCTION sys.date_to_str SYSTEM FUNCTION sys.db_users @@ -147,6 +148,7 @@ SYSTEM FUNCTION sys.difference SYSTEM FUNCTION sys.dimension SYSTEM FUNCTION sys.disjoint SYSTEM FUNCTION sys.distance +SYSTEM FUNCTION sys.droporderindex SYSTEM FUNCTION sys.env SYSTEM FUNCTION sys.envelope SYSTEM FUNCTION sys.environment @@ -212,7 +214,6 @@ SYSTEM FUNCTION sys.network SYSTEM FUNCTION sys.newurl SYSTEM FUNCTION sys.optimizer_stats SYSTEM FUNCTION sys.optimizers -SYSTEM FUNCTION sys.orderidx SYSTEM FUNCTION sys.overlaps SYSTEM FUNCTION sys.password_hash SYSTEM FUNCTION sys.pause diff --git a/clients/Tests/SQL-dump.stable.out.int128 b/clients/Tests/SQL-dump.stable.out.int128 --- a/clients/Tests/SQL-dump.stable.out.int128 +++ b/clients/Tests/SQL-dump.stable.out.int128 @@ -118,6 +118,7 @@ SYSTEM FUNCTION sys.columnsize SYSTEM FUNCTION sys.contains SYSTEM FUNCTION sys.convexhull SYSTEM FUNCTION sys.corr +SYSTEM FUNCTION sys.createorderindex SYSTEM FUNCTION sys.crosses SYSTEM FUNCTION sys.date_to_str SYSTEM FUNCTION sys.db_users @@ -143,6 +144,7 @@ SYSTEM FUNCTION sys.difference SYSTEM FUNCTION sys.dimension SYSTEM FUNCTION sys.disjoint SYSTEM FUNCTION sys.distance +SYSTEM FUNCTION sys.droporderindex SYSTEM FUNCTION sys.env SYSTEM FUNCTION sys.envelope SYSTEM FUNCTION sys.environment @@ -208,7 +210,6 @@ SYSTEM FUNCTION sys.network SYSTEM FUNCTION sys.newurl SYSTEM FUNCTION sys.optimizer_stats SYSTEM FUNCTION sys.optimizers -SYSTEM FUNCTION sys.orderidx SYSTEM FUNCTION sys.overlaps SYSTEM FUNCTION sys.password_hash SYSTEM FUNCTION sys.pause @@ -1687,156 +1688,156 @@ 6016 "minflt" "bigint" 64 0 6020 NULL tr 6017 "majflt" "bigint" 64 0 6020 NULL true 10 NULL 6018 "nvcsw" "bigint" 64 0 6020 NULL true 11 NULL 6019 "stmt" "clob" 0 0 6020 NULL true 12 NULL -6159 "user" "clob" 0 0 6165 NULL true 0 NULL -6160 "login" "timestamp" 7 0 6165 NULL true 1 NULL -6161 "sessiontimeout" "bigint" 64 0 6165 NULL true 2 NULL -6162 "lastcommand" "timestamp" 7 0 6165 NULL true 3 NULL -6163 "querytimeout" "bigint" 64 0 6165 NULL true 4 NULL -6164 "active" "boolean" 1 0 6165 NULL true 5 NULL -6242 "name" "clob" 0 0 6245 NULL true 0 NULL -6243 "def" "clob" 0 0 6245 NULL true 1 NULL -6244 "status" "clob" 0 0 6245 NULL true 2 NULL -6251 "name" "clob" 0 0 6253 NULL true 0 NULL -6252 "value" "clob" 0 0 6253 NULL true 1 NULL -6289 "qtag" "bigint" 64 0 6297 NULL true 0 NULL -6290 "user" "clob" 0 0 6297 NULL true 1 NULL -6291 "started" "timestamp" 7 0 6297 NULL true 2 NULL -6292 "estimate" "timestamp" 7 0 6297 NULL true 3 NULL -6293 "progress" "int" 32 0 6297 NULL true 4 NULL -6294 "status" "clob" 0 0 6297 NULL true 5 NULL -6295 "tag" "oid" 63 0 6297 NULL true 6 NULL -6296 "query" "clob" 0 0 6297 NULL true 7 NULL -6323 "rowid" "bigint" 64 0 6327 NULL true 0 NULL -6324 "fldid" "int" 32 0 6327 NULL true 1 NULL -6325 "message" "clob" 0 0 6327 NULL true 2 NULL -6326 "input" "clob" 0 0 6327 NULL true 3 NULL -6982 "keyword" "varchar" 40 0 6985 NULL false 0 NULL -6987 "table_type_id" "smallint" 16 0 6993 NULL false 0 NULL -6990 "table_type_name" "varchar" 25 0 6993 NULL false 1 NULL -6995 "dependency_type_id" "smallint" 16 0 7001 NULL false 0 NULL -6998 "dependency_type_name" "varchar" 15 0 7001 NULL false 1 NULL -7016 "file_id" "int" 32 0 7018 NULL true 0 NULL -7017 "location" "char" 256 0 7018 NULL true 1 NULL -7020 "dim_id" "int" 32 0 7024 NULL true 0 NULL -7021 "file_id" "int" 32 0 7024 NULL true 1 NULL -7022 "name" "varchar" 64 0 7024 NULL true 2 NULL -7023 "length" "int" 32 0 7024 NULL true 3 NULL -7026 "var_id" "int" 32 0 7032 NULL true 0 NULL -7027 "file_id" "int" 32 0 7032 NULL true 1 NULL -7028 "name" "varchar" 64 0 7032 NULL true 2 NULL -7029 "vartype" "varchar" 64 0 7032 NULL true 3 NULL -7030 "ndim" "int" 32 0 7032 NULL true 4 NULL -7031 "coord_dim_id" "int" 32 0 7032 NULL true 5 NULL -7034 "var_id" "int" 32 0 7038 NULL true 0 NULL -7035 "dim_id" "int" 32 0 7038 NULL true 1 NULL -7036 "file_id" "int" 32 0 7038 NULL true 2 NULL -7037 "dimpos" "int" 32 0 7038 NULL true 3 NULL -7040 "obj_name" "varchar" 256 0 7046 NULL true 0 NULL -7041 "att_name" "varchar" 256 0 7046 NULL true 1 NULL -7042 "att_type" "varchar" 64 0 7046 NULL true 2 NULL -7043 "value" "clob" 0 0 7046 NULL true 3 NULL -7044 "file_id" "int" 32 0 7046 NULL true 4 NULL -7045 "gr_name" "varchar" 256 0 7046 NULL true 5 NULL -7072 "schema" "clob" 0 0 7087 NULL true 0 NULL -7073 "table" "clob" 0 0 7087 NULL true 1 NULL -7074 "column" "clob" 0 0 7087 NULL true 2 NULL -7075 "type" "clob" 0 0 7087 NULL true 3 NULL -7076 "mode" "clob" 0 0 7087 NULL true 4 NULL -7077 "location" "clob" 0 0 7087 NULL true 5 NULL -7078 "count" "bigint" 64 0 7087 NULL true 6 NULL -7079 "typewidth" "int" 32 0 7087 NULL true 7 NULL -7080 "columnsize" "bigint" 64 0 7087 NULL true 8 NULL -7081 "heapsize" "bigint" 64 0 7087 NULL true 9 NULL -7082 "hashes" "bigint" 64 0 7087 NULL true 10 NULL -7083 "phash" "boolean" 1 0 7087 NULL true 11 NULL -7084 "imprints" "bigint" 64 0 7087 NULL true 12 NULL -7085 "sorted" "boolean" 1 0 7087 NULL true 13 NULL -7086 "orderidx" "bigint" 64 0 7087 NULL true 14 NULL -7089 "schema" "clob" 0 0 7100 NULL true 0 NULL -7090 "table" "clob" 0 0 7100 NULL true 1 NULL -7091 "column" "clob" 0 0 7100 NULL true 2 NULL -7092 "type" "clob" 0 0 7100 NULL true 3 NULL -7093 "typewidth" "int" 32 0 7100 NULL true 4 NULL -7094 "count" "bigint" 64 0 7100 NULL true 5 NULL -7095 "distinct" "bigint" 64 0 7100 NULL true 6 NULL -7096 "atomwidth" "int" 32 0 7100 NULL true 7 NULL -7097 "reference" "boolean" 1 0 7100 NULL true 8 NULL -7098 "sorted" "boolean" 1 0 7100 NULL true 9 NULL -7099 "orderidx" "bigint" 64 0 7100 NULL true 10 NULL -7139 "schema" "clob" 0 0 7150 NULL true 0 NULL -7140 "table" "clob" 0 0 7150 NULL true 1 NULL -7141 "column" "clob" 0 0 7150 NULL true 2 NULL -7142 "type" "clob" 0 0 7150 NULL true 3 NULL -7143 "count" "bigint" 64 0 7150 NULL true 4 NULL -7144 "columnsize" "bigint" 64 0 7150 NULL true 5 NULL -7145 "heapsize" "bigint" 64 0 7150 NULL true 6 NULL -7146 "hashes" "bigint" 64 0 7150 NULL true 7 NULL -7147 "imprints" "bigint" 64 0 7150 NULL true 8 NULL -7148 "sorted" "boolean" 1 0 7150 NULL true 9 NULL -7149 "orderidx" "bigint" 64 0 7150 NULL true 10 NULL -7152 "schema" "clob" 0 0 7160 NULL true 0 NULL -7153 "table" "clob" 0 0 7160 NULL true 1 NULL -7154 "count" "bigint" 64 0 7160 NULL true 2 NULL -7155 "columnsize" "hugeint" 128 0 7160 NULL true 3 NULL -7156 "heapsize" "hugeint" 128 0 7160 NULL true 4 NULL -7157 "hashes" "hugeint" 128 0 7160 NULL true 5 NULL -7158 "imprints" "hugeint" 128 0 7160 NULL true 6 NULL -7159 "auxiliary" "hugeint" 128 0 7160 NULL true 7 NULL -7162 "column_id" "int" 32 0 7173 NULL true 0 NULL -7163 "type" "clob" 0 0 7173 NULL true 1 NULL -7164 "width" "int" 32 0 7173 NULL true 2 NULL -7165 "stamp" "timestamp" 7 0 7173 NULL true 3 NULL -7166 "sample" "bigint" 64 0 7173 NULL true 4 NULL -7167 "count" "bigint" 64 0 7173 NULL true 5 NULL -7168 "unique" "bigint" 64 0 7173 NULL true 6 NULL -7169 "nils" "bigint" 64 0 7173 NULL true 7 NULL -7170 "minval" "clob" 0 0 7173 NULL true 8 NULL -7171 "maxval" "clob" 0 0 7173 NULL true 9 NULL -7172 "sorted" "boolean" 1 0 7173 NULL true 10 NULL -7263 "file_id" "bigint" 64 0 7271 NULL false 0 NULL -7264 "file_location" "clob" 0 0 7271 NULL false 1 NULL -7265 "dbschema" "smallint" 16 0 7271 NULL false 2 NULL -7266 "format_version" "varchar" 7 0 7271 NULL true 3 NULL -7267 "sorting_order" "varchar" 10 0 7271 NULL true 4 NULL -7268 "comments" "clob" 0 0 7271 NULL true 5 NULL -7273 "sn" "clob" 0 0 7284 NULL false 0 NULL -7274 "file_id" "bigint" 64 0 7284 NULL false 1 NULL -7275 "ln" "int" 32 0 7284 NULL true 2 NULL -7276 "as" "int" 32 0 7284 NULL true 3 NULL -7277 "m5" "clob" 0 0 7284 NULL true 4 NULL -7278 "sp" "clob" 0 0 7284 NULL true 5 NULL -7279 "ur" "clob" 0 0 7284 NULL true 6 NULL -7286 "id" "clob" 0 0 7303 NULL false 0 NULL -7287 "file_id" "bigint" 64 0 7303 NULL false 1 NULL -7288 "cn" "clob" 0 0 7303 NULL true 2 NULL -7289 "ds" "clob" 0 0 7303 NULL true 3 NULL -7290 "dt" "timestamp" 7 0 7303 NULL true 4 NULL -7291 "fo" "clob" 0 0 7303 NULL true 5 NULL -7292 "ks" "clob" 0 0 7303 NULL true 6 NULL -7293 "lb" "clob" 0 0 7303 NULL true 7 NULL -7294 "pg" "clob" 0 0 7303 NULL true 8 NULL -7295 "pi" "int" 32 0 7303 NULL true 9 NULL -7296 "pl" "clob" 0 0 7303 NULL true 10 NULL -7297 "pu" "clob" 0 0 7303 NULL true 11 NULL -7298 "sm" "clob" 0 0 7303 NULL true 12 NULL -7305 "id" "clob" 0 0 7315 NULL false 0 NULL -7306 "file_id" "bigint" 64 0 7315 NULL false 1 NULL -7307 "pn" "clob" 0 0 7315 NULL true 2 NULL -7308 "cl" "clob" 0 0 7315 NULL true 3 NULL -7309 "pp" "clob" 0 0 7315 NULL true 4 NULL -7310 "vn" "clob" 0 0 7315 NULL true 5 NULL -7317 "qname" "clob" 0 0 7328 NULL false 0 NULL -7318 "flag" "smallint" 16 0 7328 NULL false 1 NULL -7319 "rname" "clob" 0 0 7328 NULL false 2 NULL -7320 "pos" "int" 32 0 7328 NULL false 3 NULL -7321 "mapq" "smallint" 16 0 7328 NULL false 4 NULL -7322 "cigar" "clob" 0 0 7328 NULL false 5 NULL -7323 "rnext" "clob" 0 0 7328 NULL false 6 NULL -7324 "pnext" "int" 32 0 7328 NULL false 7 NULL -7325 "tlen" "int" 32 0 7328 NULL false 8 NULL -7326 "seq" "clob" 0 0 7328 NULL false 9 NULL -7327 "qual" "clob" 0 0 7328 NULL false 10 NULL -7409 "function_id" "int" 32 0 7410 NULL true 0 NULL +6164 "user" "clob" 0 0 6170 NULL true 0 NULL +6165 "login" "timestamp" 7 0 6170 NULL true 1 NULL +6166 "sessiontimeout" "bigint" 64 0 6170 NULL true 2 NULL +6167 "lastcommand" "timestamp" 7 0 6170 NULL true 3 NULL +6168 "querytimeout" "bigint" 64 0 6170 NULL true 4 NULL +6169 "active" "boolean" 1 0 6170 NULL true 5 NULL +6247 "name" "clob" 0 0 6250 NULL true 0 NULL +6248 "def" "clob" 0 0 6250 NULL true 1 NULL +6249 "status" "clob" 0 0 6250 NULL true 2 NULL _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list