Improving indexes and providing a performance increase when running reports

Improving indexes and providing a performance increase when running reports

 

Procedure Steps

 
The first 3 SQL commands provide the most improvement. The other 2 are also necessary for overall improvement. If you have any questions, please contact Technical Support for further assistance.  
 

Table

Index

ACCTRANS

USE [ACCESSCONTROL]

GO

CREATE NONCLUSTERED INDEX UDO_Report_ACCTRANS_By_Object_Time

ON [dbo].[ACCTRANS] ([ACCTRANS_OBJECTID],[TIMESTAMP])

INCLUDE ([USERID],[ACCTRANS_OPERATIONID],[ENTERVALUE],[COMPUTERN],[ACCROWID],[LNL_DBID],[USER_NOTES],[UTC_OFFSET])

GO

EVENTS

USE [ACCESSCONTROL]

GO

CREATE NONCLUSTERED INDEX UDO_Report_EventInfo_By_CardNum_Type_Time

ON [dbo].[EVENTS] ([CARDNUM],[EVENTTYPE],[EVENT_TIME_UTC])

INCLUDE ([SERIALNUM],[DEVID],[INPUTDEVID],[EVENTID],[MACHINE],[EMPID],[ISSUECODE],[CARD_EXTENDED_ID])

GO

LASTLOCATION

USE [ACCESSCONTROL]

GO

CREATE NONCLUSTERED INDEX UDO_Report_LastLocation_By_Flag_Time

ON [dbo].[LASTLOCATION] ([ACCESS_FLAG],[EVENT_TIME_UTC])

INCLUDE ([PANELID],[READERID],[CARDNUM],[EVENTID],[EVENTTYPE],[EMPID])

GO

BADGE

USE [ACCESSCONTROL]

GO

CREATE NONCLUSTERED INDEX UDO_Report_Badge_By_Status

ON [dbo].[BADGE] ([STATUS])

INCLUDE ([ID],[BADGEKEY])

GO

ACCLVLINK

USE [ACCESSCONTROL]

GO

CREATE NONCLUSTERED INDEX UDO_Report_Accvlink_By_Panel_Reader

ON [dbo].[ACCLVLINK] ([PANELID],[READERID])

INCLUDE ([ACCESSLVID],[TZID],[FLOORID])

GO

Applies To

 
SQL and OnGuard (All versions)

Additional Information


 
Use of these SQL commands may be applicable if you are experiencing unexpected timeout errors when trying to run a report.