Changeset: 3ab5fe4afcc4 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3ab5fe4afcc4 Modified Files: clients/Tests/SQL-dump.stable.out clients/Tests/SQL-dump.stable.out.int128 clients/Tests/exports.stable.out gdk/gdk.h gdk/gdk_private.h monetdb5/optimizer/opt_mitosis.c monetdb5/optimizer/opt_mitosis.h monetdb5/optimizer/opt_reorder.c sql/backends/monet5/UDF/Tests/udf-fuse.stable.out sql/backends/monet5/UDF/Tests/udf-reverse.stable.out sql/backends/monet5/sql.c sql/backends/monet5/sql_execute.c sql/backends/monet5/sql_execute.h sql/backends/monet5/sql_optimizer.c sql/backends/monet5/sql_scenario.c sql/backends/monet5/sql_scenario.h sql/include/sql_catalog.h sql/jdbc/tests/Tests/Test_Dobjects.stable.out sql/scripts/75_storagemodel.sql sql/server/sql_mvc.h sql/server/sql_parser.y sql/server/sql_scan.c sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.stable.out sql/test/BugTracker-2010/Tests/group-by_ordered_column.Bug-2564.stable.out sql/test/BugTracker-2010/Tests/group-by_ordered_column.Bug-2564.stable.out.32bit sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.sql sql/test/BugTracker-2011/Tests/count-count-distinct.Bug-2808.sql sql/test/BugTracker-2012/Tests/aggregate_vs_positional_column_crash.Bug-3085.sql sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.sql sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.out sql/test/BugTracker-2012/Tests/querycache.Bug-3212.stable.out sql/test/BugTracker-2013/Tests/qualified_aggrname.Bug-3332.sql sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.stable.out sql/test/BugTracker-2014/Tests/select-having.Bug-3458.sql sql/test/BugTracker-2015/Tests/cardinality.Bug-3761.sql sql/test/BugTracker-2016/Tests/DISTINCT_with_correlated_scalar_subquery_crashes_mserver.Bug-3920.sql sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.sql sql/test/BugTracker-2016/Tests/storagemodel.Bug-3923.stable.out sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out.32bit sql/test/Tests/systemfunctions.stable.out sql/test/Tests/systemfunctions.stable.out.int128 sql/test/bugs/Tests/crash_order_by.sql sql/test/bugs/Tests/simple_view.sql sql/test/bugs/insert_delete-bug-sf-904025.sql sql/test/orderidx/Tests/simpletable.sql sql/test/orderidx/Tests/smalltable.sql sql/test/pg_regress/Tests/vacuum.sql sql/test/pg_regress/Tests/without_oid.sql Branch: iot Log Message:
Merge with default diffs (truncated from 1744 to 300 lines): 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 @@ -846,7 +846,7 @@ create view sys.sessions as select * fro create view sys."storage" as select * from sys."storage"(); create view sys.storagemodel as select * from sys.storagemodel(); SELECT "id", "name", "schema_id", "query", CAST(CASE WHEN "system" THEN "type" + 10 ELSE (CASE WHEN "commit_action" = 0 THEN "type" ELSE "type" + 20 END) END AS SMALLINT) AS "type", "system", "commit_action", "access", CASE WHEN (NOT "system" AND "commit_action" > 0) THEN 1 ELSE 0 END AS "temporary" FROM "sys"."_tables" WHERE "type" <> 2 UNION ALL SELECT "id", "name", "schema_id", "query", CAST("type" + 30 AS SMALLINT) AS "type", "system", "commit_action", "access", 1 AS "temporary" FROM "tmp"."_tables"; -create view sys.tablestoragemodel as select "schema","table",max(count) as "count", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum(imprints) as imprints, sum(case when sorted = false then 8 * count else 0 end) as auxiliary from sys.storagemodel() group by "schema","table"; +create view sys.tablestoragemodel as select "schema","table",max(count) as "count", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum("imprints") as "imprints", sum(case when sorted = false then 8 * count else 0 end) as auxiliary from sys.storagemodel() group by "schema","table"; create view sys.tracelog as select * from sys.tracelog(); SELECT u."name" AS "name", ui."fullname", ui."default_schema" FROM db_users() AS u LEFT JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name" ; create function "abbrev" (p inet) returns clob external name inet."abbrev"; @@ -1160,11 +1160,11 @@ create aggregate stddev_samp(val time) r create aggregate stddev_samp(val timestamp) returns double external name "aggr"."stdev"; create procedure sys.stop(tag int) external name sql.sysmon_stop; create procedure sys.stop(tag bigint) external name sql.sysmon_stop; -create function sys."storage"() returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql."storage"; -create function sys."storage"(sname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql."storage"; -create function sys."storage"(sname string, tname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql."storage"; -create function sys."storage"(sname string, tname string, cname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql."storage"; -create function sys.storagemodel() returns table ("schema" string, "table" string, "column" string, "type" string, "count" bigint, columnsize bigint, heapsize bigint, hashes bigint, imprints bigint, sorted boolean, orderidx bigint) begin return select i."schema", i."table", i."column", i."type", i."count", columnsize(i."type", i.count, i."distinct"), heapsize(i."type", i."distinct", i."atomwidth"), hashsize(i."reference", i."count"), imprintsize(i."count",i."type"), i.sorted, i.orderidx from sys.storagemodelinput i; end; +create function sys."storage"() returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted boolean, orderidx bigint) external name sql."storage"; +create function sys."storage"(sname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted boolean, orderidx bigint) external name sql."storage"; +create function sys."storage"(sname string, tname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted boolean, orderidx bigint) external name sql."storage"; +create function sys."storage"(sname string, tname string, cname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted boolean, orderidx bigint) external name sql."storage"; +create function sys.storagemodel() returns table ("schema" string, "table" string, "column" string, "type" string, "count" bigint, columnsize bigint, heapsize bigint, hashes bigint, "imprints" bigint, sorted boolean, orderidx bigint) begin return select i."schema", i."table", i."column", i."type", i."count", columnsize(i."type", i.count, i."distinct"), heapsize(i."type", i."distinct", i."atomwidth"), hashsize(i."reference", i."count"), imprintsize(i."count",i."type"), i.sorted, i.orderidx from sys.storagemodelinput i; end; create procedure sys.storagemodelinit() begin delete from sys.storagemodelinput; insert into sys.storagemodelinput select x."schema", x."table", x."column", x."type", x.typewidth, x.count, 0, x.typewidth, false, x.sorted, x.orderidx from sys."storage"() x; update sys.storagemodelinput set reference = true where concat(concat("schema","table"), "column") in (select concat(concat("fkschema"."name", "fktable"."name"), "fkkeycol"."name") from "sys"."keys" as "fkkey", "sys"."objects" as "fkkeycol", "sys"."tables" as "fktable", "sys"."schemas" as "fkschema" where "fktable"."id" = "fkkey"."table_id" and "fkkey"."id" = "fkkeycol"."id" and "fkschema"."id" = "fktable"."schema_id" and "fkkey"."rkey" > -1); update sys.storagemodelinput set "distinct" = "count" where "type" = 'varchar' or "type"='clob'; end; create function str_to_date(s string, format string) returns date external name mtime."str_to_date"; create function str_to_time(s string, format string) returns time external name mtime."str_to_time"; @@ -1349,7 +1349,7 @@ drop function pcre_replace(string, strin [ "sys", "systemfunctions", NULL, 0, true, 0, 0 ] [ "sys", "table_types", NULL, 0, true, 0, 0 ] [ "sys", "tables", "SELECT \"id\", \"name\", \"schema_id\", \"query\", CAST(CASE WHEN \"system\" THEN \"type\" + 10 /* system table/view */ ELSE (CASE WHEN \"commit_action\" = 0 THEN \"type\" /* table/view */ ELSE \"type\" + 20 /* global temp table */ END) END AS SMALLINT) AS \"type\", \"system\", \"commit_action\", \"access\", CASE WHEN (NOT \"system\" AND \"commit_action\" > 0) THEN 1 ELSE 0 END AS \"temporary\" FROM \"sys\".\"_tables\" WHERE \"type\" <> 2 UNION ALL SELECT \"id\", \"name\", \"schema_id\", \"query\", CAST(\"type\" + 30 /* local temp table */ AS SMALLINT) AS \"type\", \"system\", \"commit_action\", \"access\", 1 AS \"temporary\" FROM \"tmp\".\"_tables\";", 1, true, 0, 0 ] -[ "sys", "tablestoragemodel", "create view sys.tablestoragemodel as select \"schema\",\"table\",max(count) as \"count\", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum(imprints) as imprints, sum(case when sorted = false then 8 * count else 0 end) as auxiliary from sys.storagemodel() group by \"schema\",\"table\";", 1, true, 0, 0 ] +[ "sys", "tablestoragemodel", "create view sys.tablestoragemodel as select \"schema\",\"table\",max(count) as \"count\", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum(\"imprints\") as \"imprints\", sum(case when sorted = false then 8 * count else 0 end) as auxiliary from sys.storagemodel() group by \"schema\",\"table\";", 1, true, 0, 0 ] [ "sys", "tracelog", "create view sys.tracelog as select * from sys.tracelog();", 1, true, 0, 0 ] [ "sys", "triggers", NULL, 0, true, 0, 0 ] [ "sys", "types", NULL, 0, true, 0, 0 ] @@ -3289,11 +3289,11 @@ drop function pcre_replace(string, strin [ "sys", "stddev_samp", "create aggregate stddev_samp(val wrd) returns double external name \"aggr\".\"stdev\";", "aggr", 1, 3, false, false, false ] [ "sys", "stop", "create procedure sys.stop(tag bigint) external name sql.sysmon_stop;", "sql", 1, 2, true, false, false ] [ "sys", "stop", "create procedure sys.stop(tag int) external name sql.sysmon_stop;", "sql", 1, 2, true, false, false ] -[ "sys", "storage", "create function sys.\"storage\"() returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] -[ "sys", "storage", "create function sys.\"storage\"(sname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] -[ "sys", "storage", "create function sys.\"storage\"(sname string, tname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] -[ "sys", "storage", "create function sys.\"storage\"(sname string, tname string, cname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] -[ "sys", "storagemodel", "create function sys.storagemodel() returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"count\" bigint, columnsize bigint, heapsize bigint, hashes bigint, imprints bigint, sorted boolean, orderidx bigint) begin return select i.\"schema\", i.\"table\", i.\"column\", i.\"type\", i.\"count\", columnsize(i.\"type\", i.count, i.\"distinct\"), heapsize(i.\"type\", i.\"distinct\", i.\"atomwidth\"), hashsize(i.\"reference\", i.\"count\"), imprintsize(i.\"count\",i.\"type\"), i.sorted, i.orderidx from sys.storagemodelinput i; end;", "user", 2, 5, false, false, false ] +[ "sys", "storage", "create function sys.\"storage\"() returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] +[ "sys", "storage", "create function sys.\"storage\"(sname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] +[ "sys", "storage", "create function sys.\"storage\"(sname string, tname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] +[ "sys", "storage", "create function sys.\"storage\"(sname string, tname string, cname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] +[ "sys", "storagemodel", "create function sys.storagemodel() returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"count\" bigint, columnsize bigint, heapsize bigint, hashes bigint, \"imprints\" bigint, sorted boolean, orderidx bigint) begin return select i.\"schema\", i.\"table\", i.\"column\", i.\"type\", i.\"count\", columnsize(i.\"type\", i.count, i.\"distinct\"), heapsize(i.\"type\", i.\"distinct\", i.\"atomwidth\"), hashsize(i.\"reference\", i.\"count\"), imprintsize(i.\"count\",i.\"type\"), i.sorted, i.orderidx from sys.storagemodelinput i; end;", "user", 2, 5, false, false, false ] [ "sys", "storagemodelinit", "create procedure sys.storagemodelinit() begin delete from sys.storagemodelinput; insert into sys.storagemodelinput select x.\"schema\", x.\"table\", x.\"column\", x.\"type\", x.typewidth, x.count, 0, x.typewidth, false, x.sorted, x.orderidx from sys.\"storage\"() x; update sys.storagemodelinput set reference = true where concat(concat(\"schema\",\"table\"), \"column\") in (select concat(concat(\"fkschema\".\"name\", \"fktable\".\"name\"), \"fkkeycol\".\"name\") from \"sys\".\"keys\" as \"fkkey\", \"sys\".\"objects\" as \"fkkeycol\", \"sys\".\"tables\" as \"fktable\", \"sys\".\"schemas\" as \"fkschema\" where \"fktable\".\"id\" = \"fkkey\".\"table_id\" and \"fkkey\".\"id\" = \"fkkeycol\".\"id\" and \"fkschema\".\"id\" = \"fktable\".\"schema_id\" and \"fkkey\".\"rkey\" > -1); update sys.storagemodelinput set \"distinct\" = \"count\" where \"type\" = 'varchar' or \"type\"='clob'; end;", "user", 2, 2, true, false, false ] [ "sys", "str_to_date", "create function str_to_date(s string, format string) returns date external name mtime.\"str_to_date\";", "mtime", 1, 1, false, false, false ] [ "sys", "str_to_time", "create function str_to_time(s string, format string) returns time external name mtime.\"str_to_time\";", "mtime", 1, 1, false, false, false ] 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 @@ -842,7 +842,7 @@ create view sys.sessions as select * fro create view sys."storage" as select * from sys."storage"(); create view sys.storagemodel as select * from sys.storagemodel(); SELECT "id", "name", "schema_id", "query", CAST(CASE WHEN "system" THEN "type" + 10 ELSE (CASE WHEN "commit_action" = 0 THEN "type" ELSE "type" + 20 END) END AS SMALLINT) AS "type", "system", "commit_action", "access", CASE WHEN (NOT "system" AND "commit_action" > 0) THEN 1 ELSE 0 END AS "temporary" FROM "sys"."_tables" WHERE "type" <> 2 UNION ALL SELECT "id", "name", "schema_id", "query", CAST("type" + 30 AS SMALLINT) AS "type", "system", "commit_action", "access", 1 AS "temporary" FROM "tmp"."_tables"; -create view sys.tablestoragemodel as select "schema","table",max(count) as "count", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum(imprints) as imprints, sum(case when sorted = false then 8 * count else 0 end) as auxiliary from sys.storagemodel() group by "schema","table"; +create view sys.tablestoragemodel as select "schema","table",max(count) as "count", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum("imprints") as "imprints", sum(case when sorted = false then 8 * count else 0 end) as auxiliary from sys.storagemodel() group by "schema","table"; create view sys.tracelog as select * from sys.tracelog(); SELECT u."name" AS "name", ui."fullname", ui."default_schema" FROM db_users() AS u LEFT JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name" ; create function "abbrev" (p inet) returns clob external name inet."abbrev"; @@ -1165,11 +1165,11 @@ create aggregate stddev_samp(val timesta create aggregate stddev_samp(val hugeint) returns double external name "aggr"."stdev"; create procedure sys.stop(tag int) external name sql.sysmon_stop; create procedure sys.stop(tag bigint) external name sql.sysmon_stop; -create function sys."storage"() returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql."storage"; -create function sys."storage"(sname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql."storage"; -create function sys."storage"(sname string, tname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql."storage"; -create function sys."storage"(sname string, tname string, cname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql."storage"; -create function sys.storagemodel() returns table ("schema" string, "table" string, "column" string, "type" string, "count" bigint, columnsize bigint, heapsize bigint, hashes bigint, imprints bigint, sorted boolean, orderidx bigint) begin return select i."schema", i."table", i."column", i."type", i."count", columnsize(i."type", i.count, i."distinct"), heapsize(i."type", i."distinct", i."atomwidth"), hashsize(i."reference", i."count"), imprintsize(i."count",i."type"), i.sorted, i.orderidx from sys.storagemodelinput i; end; +create function sys."storage"() returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted boolean, orderidx bigint) external name sql."storage"; +create function sys."storage"(sname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted boolean, orderidx bigint) external name sql."storage"; +create function sys."storage"(sname string, tname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted boolean, orderidx bigint) external name sql."storage"; +create function sys."storage"(sname string, tname string, cname string) returns table ("schema" string, "table" string, "column" string, "type" string, "mode" string, location string, "count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted boolean, orderidx bigint) external name sql."storage"; +create function sys.storagemodel() returns table ("schema" string, "table" string, "column" string, "type" string, "count" bigint, columnsize bigint, heapsize bigint, hashes bigint, "imprints" bigint, sorted boolean, orderidx bigint) begin return select i."schema", i."table", i."column", i."type", i."count", columnsize(i."type", i.count, i."distinct"), heapsize(i."type", i."distinct", i."atomwidth"), hashsize(i."reference", i."count"), imprintsize(i."count",i."type"), i.sorted, i.orderidx from sys.storagemodelinput i; end; create procedure sys.storagemodelinit() begin delete from sys.storagemodelinput; insert into sys.storagemodelinput select x."schema", x."table", x."column", x."type", x.typewidth, x.count, 0, x.typewidth, false, x.sorted, x.orderidx from sys."storage"() x; update sys.storagemodelinput set reference = true where concat(concat("schema","table"), "column") in (select concat(concat("fkschema"."name", "fktable"."name"), "fkkeycol"."name") from "sys"."keys" as "fkkey", "sys"."objects" as "fkkeycol", "sys"."tables" as "fktable", "sys"."schemas" as "fkschema" where "fktable"."id" = "fkkey"."table_id" and "fkkey"."id" = "fkkeycol"."id" and "fkschema"."id" = "fktable"."schema_id" and "fkkey"."rkey" > -1); update sys.storagemodelinput set "distinct" = "count" where "type" = 'varchar' or "type"='clob'; end; create function str_to_date(s string, format string) returns date external name mtime."str_to_date"; create function str_to_time(s string, format string) returns time external name mtime."str_to_time"; @@ -1356,7 +1356,7 @@ drop function pcre_replace(string, strin [ "sys", "systemfunctions", NULL, 0, true, 0, 0 ] [ "sys", "table_types", NULL, 0, true, 0, 0 ] [ "sys", "tables", "SELECT \"id\", \"name\", \"schema_id\", \"query\", CAST(CASE WHEN \"system\" THEN \"type\" + 10 /* system table/view */ ELSE (CASE WHEN \"commit_action\" = 0 THEN \"type\" /* table/view */ ELSE \"type\" + 20 /* global temp table */ END) END AS SMALLINT) AS \"type\", \"system\", \"commit_action\", \"access\", CASE WHEN (NOT \"system\" AND \"commit_action\" > 0) THEN 1 ELSE 0 END AS \"temporary\" FROM \"sys\".\"_tables\" WHERE \"type\" <> 2 UNION ALL SELECT \"id\", \"name\", \"schema_id\", \"query\", CAST(\"type\" + 30 /* local temp table */ AS SMALLINT) AS \"type\", \"system\", \"commit_action\", \"access\", 1 AS \"temporary\" FROM \"tmp\".\"_tables\";", 1, true, 0, 0 ] -[ "sys", "tablestoragemodel", "create view sys.tablestoragemodel as select \"schema\",\"table\",max(count) as \"count\", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum(imprints) as imprints, sum(case when sorted = false then 8 * count else 0 end) as auxiliary from sys.storagemodel() group by \"schema\",\"table\";", 1, true, 0, 0 ] +[ "sys", "tablestoragemodel", "create view sys.tablestoragemodel as select \"schema\",\"table\",max(count) as \"count\", sum(columnsize) as columnsize, sum(heapsize) as heapsize, sum(hashes) as hashes, sum(\"imprints\") as \"imprints\", sum(case when sorted = false then 8 * count else 0 end) as auxiliary from sys.storagemodel() group by \"schema\",\"table\";", 1, true, 0, 0 ] [ "sys", "tracelog", "create view sys.tracelog as select * from sys.tracelog();", 1, true, 0, 0 ] [ "sys", "triggers", NULL, 0, true, 0, 0 ] [ "sys", "types", NULL, 0, true, 0, 0 ] @@ -3480,11 +3480,11 @@ drop function pcre_replace(string, strin [ "sys", "stddev_samp", "create aggregate stddev_samp(val wrd) returns double external name \"aggr\".\"stdev\";", "aggr", 1, 3, false, false, false ] [ "sys", "stop", "create procedure sys.stop(tag bigint) external name sql.sysmon_stop;", "sql", 1, 2, true, false, false ] [ "sys", "stop", "create procedure sys.stop(tag int) external name sql.sysmon_stop;", "sql", 1, 2, true, false, false ] -[ "sys", "storage", "create function sys.\"storage\"() returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] -[ "sys", "storage", "create function sys.\"storage\"(sname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] -[ "sys", "storage", "create function sys.\"storage\"(sname string, tname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] -[ "sys", "storage", "create function sys.\"storage\"(sname string, tname string, cname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, imprints bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] -[ "sys", "storagemodel", "create function sys.storagemodel() returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"count\" bigint, columnsize bigint, heapsize bigint, hashes bigint, imprints bigint, sorted boolean, orderidx bigint) begin return select i.\"schema\", i.\"table\", i.\"column\", i.\"type\", i.\"count\", columnsize(i.\"type\", i.count, i.\"distinct\"), heapsize(i.\"type\", i.\"distinct\", i.\"atomwidth\"), hashsize(i.\"reference\", i.\"count\"), imprintsize(i.\"count\",i.\"type\"), i.sorted, i.orderidx from sys.storagemodelinput i; end;", "user", 2, 5, false, false, false ] +[ "sys", "storage", "create function sys.\"storage\"() returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] +[ "sys", "storage", "create function sys.\"storage\"(sname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] +[ "sys", "storage", "create function sys.\"storage\"(sname string, tname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] +[ "sys", "storage", "create function sys.\"storage\"(sname string, tname string, cname string) returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"mode\" string, location string, \"count\" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint, sorted boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5, false, false, false ] +[ "sys", "storagemodel", "create function sys.storagemodel() returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string, \"count\" bigint, columnsize bigint, heapsize bigint, hashes bigint, \"imprints\" bigint, sorted boolean, orderidx bigint) begin return select i.\"schema\", i.\"table\", i.\"column\", i.\"type\", i.\"count\", columnsize(i.\"type\", i.count, i.\"distinct\"), heapsize(i.\"type\", i.\"distinct\", i.\"atomwidth\"), hashsize(i.\"reference\", i.\"count\"), imprintsize(i.\"count\",i.\"type\"), i.sorted, i.orderidx from sys.storagemodelinput i; end;", "user", 2, 5, false, false, false ] [ "sys", "storagemodelinit", "create procedure sys.storagemodelinit() begin delete from sys.storagemodelinput; insert into sys.storagemodelinput select x.\"schema\", x.\"table\", x.\"column\", x.\"type\", x.typewidth, x.count, 0, x.typewidth, false, x.sorted, x.orderidx from sys.\"storage\"() x; update sys.storagemodelinput set reference = true where concat(concat(\"schema\",\"table\"), \"column\") in (select concat(concat(\"fkschema\".\"name\", \"fktable\".\"name\"), \"fkkeycol\".\"name\") from \"sys\".\"keys\" as \"fkkey\", \"sys\".\"objects\" as \"fkkeycol\", \"sys\".\"tables\" as \"fktable\", \"sys\".\"schemas\" as \"fkschema\" where \"fktable\".\"id\" = \"fkkey\".\"table_id\" and \"fkkey\".\"id\" = \"fkkeycol\".\"id\" and \"fkschema\".\"id\" = \"fktable\".\"schema_id\" and \"fkkey\".\"rkey\" > -1); update sys.storagemodelinput set \"distinct\" = \"count\" where \"type\" = 'varchar' or \"type\"='clob'; end;", "user", 2, 2, true, false, false ] [ "sys", "str_to_date", "create function str_to_date(s string, format string) returns date external name mtime.\"str_to_date\";", "mtime", 1, 1, false, false, false ] [ "sys", "str_to_time", "create function str_to_time(s string, format string) returns time external name mtime.\"str_to_time\";", "mtime", 1, 1, false, false, false ] diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -268,6 +268,7 @@ var_t HEAP_malloc(Heap *heap, size_t nby gdk_return HEAPextend(Heap *h, size_t size, int mayshare); size_t HEAPmemsize(Heap *h); size_t HEAPvmsize(Heap *h); +void IMPSdestroy(BAT *b); lng IMPSimprintsize(BAT *b); int MT_check_nr_cores(void); int MT_create_thread(MT_Id *t, void( *function)(void *), void *arg, enum MT_thr_detach d); @@ -1567,6 +1568,7 @@ int OPTmultiplexImplementation(Client cn str OPTmultiplexSimple(Client cntxt, MalBlkPtr mb); str OPTorcam(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p); int OPTorcamImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p); +int OPTpostfixImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p); int OPTprofilerImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p); int OPTprojectionpathImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p); int OPTpushselectImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -2021,6 +2021,7 @@ gdk_export gdk_return BAThash(BAT *b, BU */ gdk_export gdk_return BATimprints(BAT *b); +gdk_export void IMPSdestroy(BAT *b); gdk_export lng IMPSimprintsize(BAT *b); /* The ordered index structure */ diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h --- a/gdk/gdk_private.h +++ b/gdk/gdk_private.h @@ -169,8 +169,6 @@ void BBPdump(void); /* never called: fo __attribute__((__visibility__("hidden"))); __hidden int HEAPwarm(Heap *h) __attribute__((__visibility__("hidden"))); -__hidden void IMPSdestroy(BAT *b) - __attribute__((__visibility__("hidden"))); __hidden void IMPSfree(BAT *b) __attribute__((__visibility__("hidden"))); __hidden int IMPSgetbin(int tpe, bte bits, const char *restrict bins, const void *restrict v) diff --git a/monetdb5/optimizer/opt_mitosis.c b/monetdb5/optimizer/opt_mitosis.c --- a/monetdb5/optimizer/opt_mitosis.c +++ b/monetdb5/optimizer/opt_mitosis.c @@ -29,20 +29,6 @@ eligible(MalBlkPtr mb) return 1; } -/* The plans are marked with the concurrent user load. - * * If this has changed, we may want to recompile the query - * */ -int -OPTmitosisPlanOverdue(Client cntxt, str fname) -{ - Symbol s; - - s = findSymbol(cntxt->nspace, userRef, fname); - if(s ) - return s->def->activeClients != MCactiveClients(); - return 0; -} - int OPTmitosisImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p) { diff --git a/monetdb5/optimizer/opt_mitosis.h b/monetdb5/optimizer/opt_mitosis.h --- a/monetdb5/optimizer/opt_mitosis.h +++ b/monetdb5/optimizer/opt_mitosis.h @@ -15,7 +15,6 @@ #define MINPARTCNT 100000 /* minimal record count per partition */ opt_export int OPTmitosisImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p); -opt_export int OPTmitosisPlanOverdue(Client cntxt, str fname); #define OPTDEBUGmitosis if ( optDebug & ((lng)1 <<DEBUG_OPT_MITOSIS) ) diff --git a/monetdb5/optimizer/opt_reorder.c b/monetdb5/optimizer/opt_reorder.c --- a/monetdb5/optimizer/opt_reorder.c +++ b/monetdb5/optimizer/opt_reorder.c @@ -206,7 +206,7 @@ OPTbreadthfirst(Client cntxt, MalBlkPtr static int OPTpostponeAppends(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p) { - int i,j,k=0, actions =0, last; + int i,j,k=0, actions =0, last=-1; InstrPtr *old, *appends; int limit; (void) cntxt; diff --git a/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out b/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out --- a/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out +++ b/sql/backends/monet5/UDF/Tests/udf-fuse.stable.out @@ -44,11 +44,11 @@ end user.s2_1; % mal # name % clob # type % 88 # length -function user.s4_1(A0:sht,A1:sht):void; +function user.s3_1(A0:sht,A1:sht):void; X_11:void := querylog.define("explain select fuse(1000,2000);","sequential_pipe",5); X_3:int := udf.fuse(A0,A1); sql.resultSet(".L","fuse_single_value","int",32,0,7,X_3); -end user.s4_1; +end user.s3_1; #select fuse(1000,2000); % .L # table_name % fuse_single_value # name @@ -60,11 +60,11 @@ end user.s4_1; % mal # name % clob # type % 94 # length -function user.s6_1(A0:int,A1:int):void; +function user.s4_1(A0:int,A1:int):void; X_11:void := querylog.define("explain select fuse(1000000,2000000);","sequential_pipe",5); X_3:lng := udf.fuse(A0,A1); sql.resultSet(".L","fuse_single_value","bigint",64,0,7,X_3); -end user.s6_1; +end user.s4_1; #select fuse(1000000,2000000); % .L # table_name % fuse_single_value # name @@ -94,7 +94,7 @@ end user.s6_1; % mal # name % clob # type % 97 # length -function user.s14_1():void; +function user.s8_1():void; X_41:void := querylog.define("explain select fuse(a,b) from udf_fuse;","sequential_pipe",27); X_24 := bat.new(nil:oid,nil:str); X_32 := bat.append(X_24,"sys.L"); @@ -120,13 +120,13 @@ function user.s14_1():void; X_21 := algebra.projection(C_2,X_20); X_22:bat[:sht] := batudf.fuse(X_14,X_21); sql.resultSet(X_32,X_34,X_36,X_38,X_40,X_22); -end user.s14_1; +end user.s8_1; #explain select fuse(c,d) from udf_fuse; % .explain # table_name % mal # name % clob # type % 97 # length -function user.s15_1():void; +function user.s9_1():void; X_41:void := querylog.define("explain select fuse(c,d) from udf_fuse;","sequential_pipe",27); X_24 := bat.new(nil:oid,nil:str); X_32 := bat.append(X_24,"sys.L"); @@ -152,13 +152,13 @@ function user.s15_1():void; X_21 := algebra.projection(C_2,X_20); X_22:bat[:int] := batudf.fuse(X_14,X_21); sql.resultSet(X_32,X_34,X_36,X_38,X_40,X_22); -end user.s15_1; +end user.s9_1; #explain select fuse(e,f) from udf_fuse; % .explain # table_name % mal # name % clob # type % 97 # length -function user.s16_1():void; +function user.s10_1():void; X_41:void := querylog.define("explain select fuse(e,f) from udf_fuse;","sequential_pipe",27); X_24 := bat.new(nil:oid,nil:str); X_32 := bat.append(X_24,"sys.L"); @@ -184,7 +184,7 @@ function user.s16_1():void; X_21 := algebra.projection(C_2,X_20); X_22:bat[:lng] := batudf.fuse(X_14,X_21); sql.resultSet(X_32,X_34,X_36,X_38,X_40,X_22); -end user.s16_1; +end user.s10_1; #select fuse(a,b) from udf_fuse; % sys.L # table_name % fuse_a # name diff --git a/sql/backends/monet5/UDF/Tests/udf-reverse.stable.out b/sql/backends/monet5/UDF/Tests/udf-reverse.stable.out --- a/sql/backends/monet5/UDF/Tests/udf-reverse.stable.out +++ b/sql/backends/monet5/UDF/Tests/udf-reverse.stable.out @@ -83,7 +83,7 @@ end user.s2_1; % mal # name % clob # type % 101 # length -function user.s10_1():void; +function user.s6_1():void; X_33:void := querylog.define("explain select reverse(x) from udf_reverse;","sequential_pipe",22); X_17 := bat.new(nil:oid,nil:str); X_25 := bat.append(X_17,"sys.L"); @@ -104,7 +104,7 @@ function user.s10_1():void; X_14 := algebra.projection(C_2,X_13); X_15:bat[:str] := batudf.reverse(X_14); sql.resultSet(X_25,X_27,X_29,X_31,X_32,X_15); -end user.s10_1; +end user.s6_1; #select reverse(x) from udf_reverse; % sys.L # table_name _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list