BEXIS2 / Core

This is the public code repository of the BEXIS2 data management software. It contains only modules, components, and packages of the core system. Contributed modules and components will be available in separate repositories. For more information on BEXIS2, please visit our website.
https://bexis2.github.io/
17 stars 13 forks source link

Improve performance of data tuples import #437

Closed geofranzi closed 4 years ago

geofranzi commented 4 years ago

in the future:

geofranzi commented 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()}";

geofranzi commented 4 years ago

https://github.com/BEXIS2/Core/commit/fe14f578d3ef6733f85d3d2862640dee196a5671

DavidBlaa commented 4 years ago

can we close this issue? the generation of the view seems to work