0

I am using LLBLGenPro for my project.I'm curious about what will be more effective way for query i.e 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.i.e why I need to know the best way to do things

user19041992
  • 133
  • 1
  • 5
  • 18

1 Answers1

0

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.

S Waye
  • 694
  • 1
  • 7
  • 12