0

I have a doubt in terms of performance.

What is better?

  1. Multiple nested Inner Joins + SubQueries with a specific WHERE clause (the table has indexes).
  2. Creating a virtual table with row data and relating it with Inner Joins?
Pang
  • 9,564
  • 146
  • 81
  • 122
AMF
  • 1
  • Try both queries and check the execution plan... – Abdul Rasheed Oct 29 '18 at 08:27
  • 1
    Can you show us SQL code for both cases, and maybe some data as well? Your question is kind of not specific. – Tim Biegeleisen Oct 29 '18 at 08:28
  • 3
    You can always run both, measure, find out - come back and tell us - real evidence tends to be better than the thought experiment. – Andrew Oct 29 '18 at 08:32
  • Ok, I will do both Queries and I will tell you the times! – AMF Oct 29 '18 at 08:35
  • 2
    Worth reading Eric Lippert's [Which is faster?](https://ericlippert.com/2012/12/17/performance-rant/) too. Although there a slight .NET slant at the start, most of it is broadly applicable across languages/technologies. – Damien_The_Unbeliever Oct 29 '18 at 08:39
  • My current generic comment re "better"/"best" etc: There's no such thing as "better"/"best" in engineering unless *you* define it. Also unfortunately all reasonable practical definitions require a ridiculous amount of experience with a ridiculous number of factors that interact with chaotic sensitivity to details. Make straightforward designs. When you demonstrate via measurement that a design and all alternatives you can think of have problems (whatever that means at the time), then ask a very specific question. Which should also define "better"/"best". https://meta.stackexchange.com/q/204461 – philipxy Oct 29 '18 at 08:55

0 Answers0