0

I have 5 table in database as shown in image below link

The join is like this:

 tableA----->tableB------>tableC---------->tableD----->table

see image for fields [NAME fields in image is Amount and is in nvarchar(max) ]

IMAGE OF RELATION

Now I want to apply optimized queries to save response time like

1-sum (amount) of all db by making join of A TO B B TO C TO D 2-simlarly agreagate function in where clause 3-calculations any 4-count

I prefer a solution without INNER JOIN since it takes more response time and it fails if any 1 join fails.

in most cases failure in relation of A---B does not give record of C ETC

shA.t
  • 16,580
  • 5
  • 54
  • 111
GLOBAL TECH
  • 71
  • 10
  • Unclear what you are asking. You show no effort and throw some ridiculous quote in (inner join more response time? That makes NO sense). Read the FAQ how to formulate a good question and understand - we are not here to do all your work. – TomTom Feb 27 '16 at 07:10
  • now @tom some effort shown] – GLOBAL TECH Feb 27 '16 at 07:18
  • No. Back to you: WHY does it take 50 seconds? Are we supposed to make up the execution plan? I would suggest, given the amount of competence shown so far, you miss some critical indices for the query. – TomTom Feb 27 '16 at 07:24
  • can you please lil modify that or make execution plan for that query or assign some indices i will be thankfull – GLOBAL TECH Feb 27 '16 at 07:29
  • Dude, the execution plan is something you get from your sql server and it shows where the time is spent. This is basic debugging - without execution plan we are looking blind. You expect me to to your basic work? Get real. Read http://stackoverflow.com/questions/7359702/how-do-i-obtain-a-query-execution-plan and then provide it. – TomTom Feb 27 '16 at 07:31
  • And we need actual and estimated plans. Sometimes they differ which points to a possible server problem. – TomTom Feb 27 '16 at 07:32
  • @Tech "Make execution plan" is a button on your toolbar. – Ivan Starostin Feb 27 '16 at 07:35
  • only include excution plan is available but there is no button for makw execution plan in sql server management studio 2008r2 – GLOBAL TECH Feb 27 '16 at 08:13
  • 2
    These are hard times. _Never believe any war will be smooth and easy or that anyone who embarks on that strange voyage can measure the tides and hurricanes he will encounter. The statesman who yields to war fever must realize that once the signal is given, he is no longer the master of policy but the slave of unforeseeable and uncontrollable events…_ You are permitted to push that button, private. Dismissed! – Ivan Starostin Feb 27 '16 at 09:14
  • @IvanStarostin Churchill to the rescue =) – TT. Feb 27 '16 at 11:49
  • ridals die hard my bro this is 2016 still older tactics of war you are using with that technique you are still optimistic that events are not controllable this is open source world 21st century global world we can use ddl to make own db by the way i found a way to make optimize query by measuring their results by writing query and notiicing reasponse time thankyou for participating generals \ – GLOBAL TECH Feb 29 '16 at 06:00

0 Answers0