2 Commits

Author SHA1 Message Date
Jonathan Jenne
c8d052ed1d EDMIService: Version 2.2.0 2021-09-13 15:42:47 +02:00
Jonathan Jenne
6c2bf88cfc EDMIService: Add dataview to create indexes on cached tables 2021-09-13 15:42:04 +02:00
3 changed files with 16 additions and 2 deletions

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.1.2.0")> <Assembly: AssemblyVersion("2.2.0.0")>
<Assembly: AssemblyFileVersion("2.1.2.0")> <Assembly: AssemblyFileVersion("2.2.0.0")>

View File

@@ -36,6 +36,7 @@ Public Class DatatableJob
Dim oConnectionId As Integer = NotNull(oRow.Item("CON_ID"), String.Empty) Dim oConnectionId As Integer = NotNull(oRow.Item("CON_ID"), String.Empty)
Dim oTitle As String = NotNull(oRow.Item("TITLE"), String.Empty) Dim oTitle As String = NotNull(oRow.Item("TITLE"), String.Empty)
Dim oSQL As String = NotNull(oRow.Item("COMMAND"), String.Empty) Dim oSQL As String = NotNull(oRow.Item("COMMAND"), String.Empty)
Dim oIndexColumns As String = NotNull(oRow.Item("INDEX_COLUMNS"), String.Empty)
Try Try
oLogger.Debug("Running Command-Job [{0}]", oTitle) oLogger.Debug("Running Command-Job [{0}]", oTitle)
@@ -46,10 +47,22 @@ Public Class DatatableJob
Dim oTable = oMSSQL.GetDatatableWithConnection(oSQL, oConnectionString, COMMAND_SQL_TIMEOUT) Dim oTable = oMSSQL.GetDatatableWithConnection(oSQL, oConnectionString, COMMAND_SQL_TIMEOUT)
oTable.TableName = oDatatableName oTable.TableName = oDatatableName
Dim oView As DataView = Nothing
' This creates an Index for the columns specified in INDEX_COLUMNS to speed up calls to 'Table.Select'!
If oIndexColumns <> String.Empty Then
oLogger.Debug("Adding indexes for Table: [{0}]", oIndexColumns)
oView = New DataView(oTable) With {
.Sort = oIndexColumns
}
End If
oLogger.Debug("Result Datatable [{0}] contains [{1}] rows", oTable.TableName, oTable.Rows.Count) oLogger.Debug("Result Datatable [{0}] contains [{1}] rows", oTable.TableName, oTable.Rows.Count)
Dim oResultTable = New JobResult.ResultTable() With { Dim oResultTable = New JobResult.ResultTable() With {
.Table = oTable, .Table = oTable,
.View = oView,
.DetailRow = oRow .DetailRow = oRow
} }

View File

@@ -3,6 +3,7 @@
Public Class ResultTable Public Class ResultTable
Public Table As DataTable Public Table As DataTable
Public View As DataView
Public ChildTable As DataTable Public ChildTable As DataTable
Public TableRelationColumn As String Public TableRelationColumn As String
Public ChildRelationColumn As String Public ChildRelationColumn As String