EDMIService: Add dataview to create indexes on cached tables
This commit is contained in:
parent
9fc5092fc7
commit
6c2bf88cfc
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user