This commit is contained in:
@@ -13,21 +13,8 @@ using AyaNova.Models;
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
using (var command = ct.Database.GetDbConnection().CreateCommand())
|
||||
{
|
||||
command.CommandText = $"SELECT m.name FROM awidget AS m WHERE m.id = {id} LIMIT 1";
|
||||
ct.Database.OpenConnection();
|
||||
using (var dr = command.ExecuteReader())
|
||||
{
|
||||
|
||||
// do something with result
|
||||
return dr.Read() ? dr.GetString(0) : "UNKNOWN";
|
||||
}
|
||||
}
|
||||
*/
|
||||
//Turn a type and ID into a displayable name
|
||||
//this version uses a direct DataReader for performance in tight loops (search)
|
||||
internal static class BizObjectNameFetcherDirect
|
||||
{
|
||||
|
||||
|
||||
@@ -375,32 +375,7 @@ namespace AyaNova.Biz
|
||||
watch.Stop();//###################### PROFILING
|
||||
var TimeToBuildSearchResultReturnList = watch.ElapsedMilliseconds;//###################### PROFILING
|
||||
|
||||
//Before attempt to optimize name fetcher
|
||||
//22548, 21187, 20462, 22336, 20094 - AVG = 21325
|
||||
|
||||
/*
|
||||
explain analyze SELECT m.name
|
||||
FROM awidget AS m
|
||||
WHERE m.id = 12989
|
||||
LIMIT 1
|
||||
|
||||
|
||||
"Limit (cost=0.29..8.30 rows=1 width=27) (actual time=0.079..0.080 rows=1 loops=1)"
|
||||
" -> Index Scan using awidget_pkey on awidget m (cost=0.29..8.30 rows=1 width=27) (actual time=0.077..0.077 rows=1 loops=1)"
|
||||
" Index Cond: (id = 12989)"
|
||||
"Planning time: 0.098 ms"
|
||||
"Execution time: 0.102 ms"
|
||||
|
||||
|
||||
//All index data
|
||||
select * from pg_stat_user_indexes
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
return ResultList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user