简体   繁体   English

LLBLGen Pro-Join与预取路径

[英]LLBLGen Pro- Join Vs prefetch Path

I am using LLBLGenPro for my project.I'm curious about what will be more effective way for query ie join or prefetch path. 我正在为我的项目使用LLBLGenPro。我很好奇什么是更有效的查询方式,即连接或预取路径。

I observed that when I am using prefetch path,it actually firing separate queries on database with Scalable resultset where as In case of join ,It is normal join query with bloated resultSet. 我观察到,当我使用预取路径时,它实际上在具有可伸缩结果集的数据库上触发了单独的查询,其中对于join来说,这是带有normal肿的resultSet的普通联接查询。

I am facing performance issues in my application.ie why I need to know the best way to do things 我在应用程序中遇到性能问题。即为什么我需要知道做事的最佳方法

I would say this depends on the relation between the 2 tables. 我会说这取决于两个表之间的关系。 If its 1-1 then a join is probably going to be more efficient from the database point of view (its just one query and no rows are duplicated). 如果它是1-1,那么从数据库的角度来看,联接可能会更有效率(它只是一个查询,没有重复的行)。 Otherwise if you have a 1-m or 1-0..1 relationship then it can be better to do a prefetch. 否则,如果您具有1-m或1-0..1关系,则最好进行预取。 LLBLGen is smart enough to either do that as 2 queries using a where in clause with either a subselect or a list of values from the parent query depending on the number of results from the parent query (default for switching to subquery is 50 and can be changed using DataAccessAdapter.ParameterisedPrefetchPathThreshold ). LLBLGen足够聪明,可以使用带有inselect子句的where in子句作为父查询的值列表,将其作为2个查询来执行(取决于父查询的结果数量(切换到子查询的默认值为50,可以是使用DataAccessAdapter.ParameterisedPrefetchPathThreshold更改)。 If you've got performance problems then it's a good idea to run a trace, grab the sql and profile it to check the query plans. 如果您遇到性能问题,那么最好运行跟踪,获取sql并对其进行分析,以检查查询计划。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM