PersonalAnalytics
PersonalAnalytics copied to clipboard
Optimize Database Performance
- •optimize inserts (useful for User Input Stuff): http://stackoverflow.com/questions/1711631/improve-insert-per-second-performance-of-sqlite
- •think about suggestions from SDL Tool:
- •google around for query optimization
- •ADD indixes
- •PROBLEM: DB is sometimes locked if much data is stored (-> lags). maybe DB on separate thread or better DB lock handling?
- •OPTIMIZE Queries (e.g. check time spent in each query to see where it wastes time)
Some Logs 1>C:\DATA\MS-PA\AM.PA.MonitoringTool\Shared\Data\DatabaseImplementation.cs(40): warning CA2100: Microsoft.Security : The query string passed to 'SQLiteCommand.SQLiteCommand(string, SQLiteConnection)' in 'DatabaseImplementation.ExecuteDefaultQuery(string)' could contain the following variables 'query'. If any of these variables could come from user input, consider using a stored procedure or a parameterized SQL query instead of building the query with string concatenations.
1>C:\DATA\MS-PA\AM.PA.MonitoringTool\Shared\Data\DatabaseImplementation.cs(135): warning CA2100: Microsoft.Security : The query string passed to 'SQLiteCommand.SQLiteCommand(string, SQLiteConnection)' in 'DatabaseImplementation.ExecuteReadQuery(string)' could contain the following variables 'query'. If any of these variables could come from user input, consider using a stored procedure or a parameterized SQL query instead of building the query with string concatenations.
1>C:\DATA\MS-PA\AM.PA.MonitoringTool\Shared\Data\DatabaseImplementation.cs(68): warning CA2100: Microsoft.Security : The query string passed to 'SQLiteCommand.SQLiteCommand(string, SQLiteConnection)' in 'DatabaseImplementation.ExecuteScalar(string)' could contain the following variables 'query'. If any of these variables could come from user input, consider using a stored procedure or a parameterized SQL query instead of building the query with string concatenations.
1>C:\DATA\MS-PA\AM.PA.MonitoringTool\Shared\Data\DatabaseImplementation.cs(120): warning CA2100: Microsoft.Security : The query string passed to 'SQLiteCommand.SQLiteCommand(string, SQLiteConnection)' in 'DatabaseImplementation.ExecuteScalar2(string)' could contain the following variables 'query'. If any of these variables could come from user input, consider using a stored procedure or a parameterized SQL query instead of building the query with string concatenations.
1>C:\DATA\MS-PA\AM.PA.MonitoringTool\Shared\Data\DatabaseImplementation.cs(340): warning CA2100: Microsoft.Security : The query string passed to 'SQLiteCommand.SQLiteCommand(string, SQLiteConnection)' in 'DatabaseImplementation.GetUserWorkEnd(DateTimeOffset)' could contain the following variables 'new string[5][1]'. If any of these variables could come from user input, consider using a stored procedure or a parameterized SQL query instead of building the query with string concatenations.
1>C:\DATA\MS-PA\AM.PA.MonitoringTool\Shared\Data\DatabaseImplementation.cs(314): warning CA2100: Microsoft.Security : The query string passed to 'SQLiteCommand.SQLiteCommand(string, SQLiteConnection)' in 'DatabaseImplementation.GetUserWorkStart(DateTimeOffset)' could contain the following variables 'new string[5][1]'. If any of these variables could come from user input, consider using a stored procedure or a parameterized SQL query instead of building the query with string concatenations.
Parameterize Queries: http://stackoverflow.com/questions/1318023/performance-of-parameterized-queries-for-different-dbs
Closing as reported for legacy version of PersonalAnalytics.