From 40cb308fbb4e6992a42bcb3e01abe50cef51237c Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 14 Oct 2021 22:30:26 +0000 Subject: [PATCH] fixed slow customers and units list --- .vscode/launch.json | 4 ++-- server/AyaNova/DataList/DataListFetcher.cs | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index f82ad010..976f60e9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -52,8 +52,8 @@ "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", "AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles", - "AYANOVA_SERVER_TEST_MODE": "false", - "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "huge", + "AYANOVA_SERVER_TEST_MODE": "true", + "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7", "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\" }, diff --git a/server/AyaNova/DataList/DataListFetcher.cs b/server/AyaNova/DataList/DataListFetcher.cs index bf3861e1..831aaa3d 100644 --- a/server/AyaNova/DataList/DataListFetcher.cs +++ b/server/AyaNova/DataList/DataListFetcher.cs @@ -1,3 +1,5 @@ +//#define AYSHOWQUERYINFO + using System.Collections.Generic; using System.Linq; using AyaNova.Biz; @@ -12,6 +14,7 @@ namespace AyaNova.DataList internal static class DataListFetcher { + //////////////////////////////////////////////// // Get the data list data requested // @@ -52,7 +55,7 @@ namespace AyaNova.DataList int returnRowColumnCount = dataListTableProcessingOptions.Columns.Count(); List> rows = new List>(); long totalRecordCount = 0; -#if (DEBUG) +#if (DEBUG && AYSHOWQUERYINFO) System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch(); #endif @@ -65,12 +68,12 @@ namespace AyaNova.DataList command.CommandText = qDataQuery; try { -#if (DEBUG) +#if (DEBUG && AYSHOWQUERYINFO) stopWatch.Start(); #endif using (var dr = await command.ExecuteReaderAsync()) { -#if (DEBUG) +#if (DEBUG && AYSHOWQUERYINFO) stopWatch.Stop(); log.LogInformation($"(debug) DataListFetcher:GetResponse DATA query took {stopWatch.ElapsedMilliseconds}ms to execute: {qDataQuery}"); stopWatch.Reset(); @@ -160,12 +163,12 @@ namespace AyaNova.DataList //GET TOTAL RECORD COUNT command.CommandText = qTotalRecordsQuery; -#if (DEBUG) +#if (DEBUG && AYSHOWQUERYINFO) stopWatch.Start(); #endif using (var dr = await command.ExecuteReaderAsync()) { -#if (DEBUG) +#if (DEBUG && AYSHOWQUERYINFO) stopWatch.Stop(); log.LogInformation($"(debug) DataListFetcher:GetResponse COUNT query took {stopWatch.ElapsedMilliseconds}ms to execute: {qTotalRecordsQuery}"); #endif