简体   繁体   中英

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.

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.

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). Otherwise if you have a 1-m or 1-0..1 relationship then it can be better to do a prefetch. 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 ). 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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