@query-doctor/core 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1712,7 +1712,7 @@ var IndexOptimizer = class IndexOptimizer {
1712
1712
  flags.push("analyze");
1713
1713
  if (this.config.trace) flags.push("trace");
1714
1714
  } else flags.push("generic_plan");
1715
- const { commands, query } = builder.explain(flags).buildParts();
1715
+ const { commands, query } = builder.introspect().explain(flags).buildParts();
1716
1716
  await tx.exec(commands);
1717
1717
  const explain = (await tx.exec(query, options?.params))[0]["QUERY PLAN"][0];
1718
1718
  throw new RollbackError(explain);
@@ -1928,11 +1928,51 @@ var Statistics = class Statistics {
1928
1928
  const columnStatsValues = [];
1929
1929
  if (this.exportedMetadata) {
1930
1930
  for (const table of this.ownMetadata) {
1931
- const targetTable = this.exportedMetadata.find((m) => m.tableName === table.tableName && m.schemaName === table.schemaName);
1932
- if (!targetTable?.columns) continue;
1933
- for (const column of targetTable.columns) {
1931
+ if (!table.columns) continue;
1932
+ for (const column of table.columns) {
1934
1933
  const { stats } = column;
1935
- if (!stats) continue;
1934
+ if (!stats) {
1935
+ columnStatsValues.push({
1936
+ schema_name: table.schemaName,
1937
+ table_name: table.tableName,
1938
+ column_name: column.columnName,
1939
+ stainherit: false,
1940
+ stanullfrac: .1,
1941
+ stawidth: 20,
1942
+ stadistinct: .1,
1943
+ stakind1: 0,
1944
+ stakind2: 0,
1945
+ stakind3: 0,
1946
+ stakind4: 0,
1947
+ stakind5: 0,
1948
+ stacoll1: "",
1949
+ stacoll2: "",
1950
+ stacoll3: "",
1951
+ stacoll4: "",
1952
+ stacoll5: "",
1953
+ staop1: "",
1954
+ staop2: "",
1955
+ staop3: "",
1956
+ staop4: "",
1957
+ staop5: "",
1958
+ stanumbers1: null,
1959
+ stanumbers2: null,
1960
+ stanumbers3: null,
1961
+ stanumbers4: null,
1962
+ stanumbers5: null,
1963
+ stavalues1: null,
1964
+ stavalues2: null,
1965
+ stavalues3: null,
1966
+ stavalues4: null,
1967
+ stavalues5: null,
1968
+ _value_type1: "real",
1969
+ _value_type2: "real",
1970
+ _value_type3: "real",
1971
+ _value_type4: "real",
1972
+ _value_type5: "real"
1973
+ });
1974
+ continue;
1975
+ }
1936
1976
  columnStatsValues.push({
1937
1977
  schema_name: table.schemaName,
1938
1978
  table_name: table.tableName,