Closed geofranzi closed 4 years ago
rewrite mat view query: saves 1/3 of the time:
CASE (xpath('/Content/Item[Property[@Name="VariableId" and @value="1"]][1]/Property[@Name="Value"]/@value', t.xmlvariablevalues)::text) WHEN '{""}'::text THEN NULL WHEN '{_null_null}'::text THEN NULL ELSE cast((xpath('/Content/Item[Property[@Name="VariableId" and @value="1"]][1]/Property[@Name="Value"]/@value', t.xmlvariablevalues)::character varying[])[1] AS float8) END AS var1,
WHERE v.datasetref = 1 AND v.status in (0,2)
L160 .AppendLine(string.Format("WHERE v.datasetref = {0} AND v.status in (0,2)", datasetId))
L322 string fieldDef = $"CASE {accessPath}::text WHEN '{{\"\"}}'::text THEN NULL WHEN'{{_null_null}}'::text THEN NULL ELSE cast(({accessPath}::character varying[])[1] {fieldType}) END AS {this.BuildColumnName(Id).ToLower()}";
can we close this issue? the generation of the view seems to work
in the future: