dynamicweb / DynamicWeb

Make feature requests for Dynamicweb in Issues section of this repository
https://doc.dynamicweb.dev/documentation/fundamentals/support/feature-requests.html
GNU General Public License v3.0
1 stars 0 forks source link

Many database calls for assortments #48

Closed dwlhs closed 1 month ago

dwlhs commented 1 month ago

I've configured a solution for assortments. I have a list of 12 products in the frontend. In the execution table I'm counting 204 identical database lookups, maybe 17 per product in the list:

image

This is the stack trace:

DECLARE @p0 INT = 1789 SELECT [AccessUserGroupRelationGroupId] FROM [AccessUserGroupRelation] WHERE [AccessUserGroupRelationUserId] IN (@p0) System.Data.IDataReader CreateDataReader(System.Data.IDbCommand, System.Data.CommandBehavior) (Dynamicweb.Core.dll) in :0 System.Data.IDataReader CreateDataReader(Dynamicweb.Data.CommandBuilder, System.Data.IDbConnection, System.Data.IDbTransaction, System.Data.CommandBehavior, Int32) (Dynamicweb.Core.dll) in :0 System.Data.IDataReader CreateDataReader(Dynamicweb.Data.CommandBuilder, System.Data.IDbConnection, System.Data.IDbTransaction, Int32) (Dynamicweb.Core.dll) in :0 System.Collections.Generic.IEnumerable1[System.Int32] GetGroupIdsByUserId(System.Collections.Generic.IEnumerable1[System.Int32]) (Dynamicweb.Core.dll) in :0 System.Collections.Generic.IEnumerable1[System.String] GetAssortmentIdsByUser(Dynamicweb.Security.UserManagement.User, Boolean) (Dynamicweb.Ecommerce.dll) in :0 System.Collections.Generic.IEnumerable1[System.String] GetMyAssortments() (Dynamicweb.Ecommerce.dll) in :0 System.Object <.cctor>b__12_0() (Dynamicweb.Ecommerce.dll) in :0 System.Object Evaluate(Dynamicweb.Extensibility.Macros.MacroAction) (Dynamicweb.Ecommerce.dll) in :0 System.Object Evaluate(System.String) (Dynamicweb.Core.dll) in :0 System.Object GetValueFromExpression(Dynamicweb.Indexing.Querying.Expressions.Expression, System.Collections.Generic.IDictionary2[System.String,System.Object]) (Dynamicweb.Indexing.Lucene4.dll) in :0 Lucene.Net.Search.Query ParseQueryExpressionInternal(Dynamicweb.Indexing.IIndex, Dynamicweb.Indexing.Querying.Expressions.Expression, Lucene.Net.Analysis.Analyzer, Dynamicweb.Indexing.Querying.QuerySettings) (Dynamicweb.Indexing.Lucene4.dll) in :0 Lucene.Net.Search.Query ParseQueryExpressionInternal(Dynamicweb.Indexing.IIndex, Dynamicweb.Indexing.Querying.Expressions.Expression, Lucene.Net.Analysis.Analyzer, Dynamicweb.Indexing.Querying.QuerySettings) (Dynamicweb.Indexing.Lucene4.dll) in :0 Lucene.Net.Search.Query ParseQueryExpressionInternal(Dynamicweb.Indexing.IIndex, Dynamicweb.Indexing.Querying.Expressions.Expression, Lucene.Net.Analysis.Analyzer, Dynamicweb.Indexing.Querying.QuerySettings) (Dynamicweb.Indexing.Lucene4.dll) in :0 Lucene.Net.Search.Query ParseQueryExpression(Dynamicweb.Indexing.IIndex, Dynamicweb.Indexing.Querying.Expressions.Expression, Dynamicweb.Indexing.Querying.QuerySettings) (Dynamicweb.Indexing.Lucene4.dll) in :0 Dynamicweb.Indexing.Querying.IQueryResult SearchInternal(Dynamicweb.Indexing.Querying.IQuery, Dynamicweb.Indexing.Querying.QuerySettings) (Dynamicweb.Indexing.Lucene4.dll) in :0 Dynamicweb.Indexing.Querying.IQueryResult Query(Dynamicweb.Indexing.Querying.IQuery, Dynamicweb.Indexing.Querying.QuerySettings) (Dynamicweb.Indexing.Lucene4.dll) in :0 Dynamicweb.Indexing.Querying.IQueryResult Query(Dynamicweb.Indexing.Querying.IQuery, Dynamicweb.Indexing.Querying.QuerySettings) (Dynamicweb.Core.dll) in :0 Dynamicweb.Indexing.Querying.IQueryResult Query(Dynamicweb.Indexing.Querying.IQuery, Dynamicweb.Indexing.Querying.QuerySettings) (Dynamicweb.Core.dll) in :0 Dynamicweb.Indexing.Querying.IQueryResult ExecuteQuery(Dynamicweb.Indexing.Querying.IQuery, Dynamicweb.Indexing.Querying.QuerySettings) (Dynamicweb.Ecommerce.dll) in :0 System.Collections.Generic.IList1[System.Int64] GetProductsAutoIdsFromIndexQuery(Dynamicweb.Indexing.Querying.IQuery, Dynamicweb.Ecommerce.ProductCatalog.ProductCatalogSettings, Dynamicweb.Indexing.Querying.QuerySettings, System.Collections.Generic.IEnumerable1[Dynamicweb.Ecommerce.ProductCatalog.FacetGroupViewModel] ByRef, System.Collections.Generic.IEnumerable1[System.String] ByRef) (Dynamicweb.Ecommerce.dll) in :0 System.String RenderProductList(Dynamicweb.Ecommerce.ProductCatalog.ProductCatalogSettings, Dynamicweb.Indexing.Querying.QuerySettings, Dynamicweb.Indexing.Querying.IQuery, System.String, Boolean) (Dynamicweb.Ecommerce.dll) in :0 Dynamicweb.Frontend.OutputResult GetModuleContent() (Dynamicweb.Ecommerce.dll) in :0 Dynamicweb.Frontend.OutputResult GetModuleOutput(Dynamicweb.Content.Paragraph, Dynamicweb.Frontend.PageView) (Dynamicweb.dll) in :0 Dynamicweb.Frontend.OutputResult RenderParagraph(Dynamicweb.Content.Paragraph, Dynamicweb.Frontend.ContainerInfo, Dynamicweb.Rendering.Designer.Layout, Dynamicweb.Frontend.GridColumnViewModel) (Dynamicweb.dll) in :0 Dynamicweb.Frontend.OutputResult RenderGridColumn(Dynamicweb.Frontend.GridColumnViewModel) (Dynamicweb.dll) in :0 Dynamicweb.Frontend.OutputResult CreateGridRowViewModel(Dynamicweb.Rendering.Designer.Layout, System.String, Dynamicweb.Content.GridRow, System.Collections.Generic.IEnumerable1[Dynamicweb.Content.Paragraph], System.Func2[Dynamicweb.Frontend.GridColumnViewModel,Dynamicweb.Frontend.OutputResult]) (Dynamicweb.dll) in :0 Dynamicweb.Frontend.OutputResult CreateGridViewModel(Dynamicweb.Rendering.Designer.Layout, System.String, System.Collections.Generic.IEnumerable1[Dynamicweb.Content.GridRow], System.Collections.Generic.IEnumerable1[Dynamicweb.Content.Paragraph], System.Func2[Dynamicweb.Frontend.GridColumnViewModel,Dynamicweb.Frontend.OutputResult]) (Dynamicweb.dll) in :0 Dynamicweb.Frontend.ContentCollection CreateGridContent(System.Collections.Generic.IEnumerable1[Dynamicweb.Content.GridRow], System.Collections.Generic.IEnumerable`1[Dynamicweb.Content.Paragraph], Dynamicweb.Rendering.Designer.Layout) (Dynamicweb.dll) in :0 Dynamicweb.Frontend.ContentCollection CreateGridContent(Int32, Boolean) (Dynamicweb.dll) in :0 Dynamicweb.Frontend.ContentCollection CreateGridContent(Int32) (Dynamicweb.dll) in :0 Dynamicweb.Frontend.ContentCollection GetGridContent() (Dynamicweb.dll) in :0 Dynamicweb.Frontend.OutputResult CreatePageViewModelOutput(Dynamicweb.Frontend.PageView) (Dynamicweb.dll) in :0 Dynamicweb.Frontend.OutputResult SetPageTemplateValues() (Dynamicweb.dll) in :0 Dynamicweb.Frontend.OutputResult Output() (Dynamicweb.dll) in :0 Void MoveNext() (Dynamicweb.Frontend.Classic.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Dynamicweb.Frontend.Classic.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Microsoft.AspNetCore.Http.Abstractions.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Microsoft.AspNetCore.Http.Abstractions.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Microsoft.AspNetCore.Http.Abstractions.dll) in :0 Void MoveNext() (Dynamicweb.Frontend.Classic.dll) in :0 System.Threading.Tasks.Task InvokeAsync(Microsoft.AspNetCore.Http.HttpContext) (Dynamicweb.Frontend.Classic.dll) in :0 Void MoveNext() (Microsoft.AspNetCore.Authentication.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Microsoft.AspNetCore.Authentication.dll) in :0 Void MoveNext() (Microsoft.AspNetCore.Authentication.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Microsoft.AspNetCore.Authentication.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Microsoft.AspNetCore.StaticFiles.dll) in :0 Void MoveNext() (NSwag.AspNetCore.dll) in :0 Void MoveNext() (NSwag.AspNetCore.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (NSwag.AspNetCore.dll) in :0 Void MoveNext() (Dynamicweb.Host.Core.dll) in :0 Void MoveNext() (Dynamicweb.Host.Core.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Dynamicweb.Host.Core.dll) in :0 Void MoveNext() (Dynamicweb.Host.Core.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Dynamicweb.Host.Core.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Microsoft.AspNetCore.StaticFiles.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Microsoft.AspNetCore.StaticFiles.dll) in :0 Void MoveNext() (Microsoft.AspNetCore.Authorization.Policy.dll) in :0 System.Threading.Tasks.Task Invoke(Microsoft.AspNetCore.Http.HttpContext) (Microsoft.AspNetCore.HostFiltering.dll) in :0 Void MoveNext() (Microsoft.AspNetCore.Server.IIS.dll) in :0 Void MoveNext() (Microsoft.AspNetCore.Server.IIS.dll) in :0 System.Threading.Tasks.Task HandleRequest() (Microsoft.AspNetCore.Server.IIS.dll) in :0 Void Execute() (Microsoft.AspNetCore.Server.IIS.dll) in :0

All in all it doesn't take long to process, but it could be that there is room for improvement.

nicped commented 1 month ago

Registered as a bug, https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/19774