Azure SQL Server - big query choosing bad execution plan Announcing the arrival of Valued...

Fundamental Solution of the Pell Equation

Amount of permutations on an NxNxN Rubik's Cube

Quick way to create a symlink?

Why didn't Eitri join the fight?

Do square wave exist?

Compare a given version number in the form major.minor.build.patch and see if one is less than the other

What is the escape velocity of a neutron particle (not neutron star)

Can anything be seen from the center of the Boötes void? How dark would it be?

Using et al. for a last / senior author rather than for a first author

Is it common practice to audition new musicians 1-2-1 before rehearsing with the entire band?

Do jazz musicians improvise on the parent scale in addition to the chord-scales?

How to show element name in portuguese using elements package?

Around usage results

Irreducible of finite Krull dimension implies quasi-compact?

Wu formula for manifolds with boundary

What does the "x" in "x86" represent?

How to react to hostile behavior from a senior developer?

Find the length x such that the two distances in the triangle are the same

First console to have temporary backward compatibility

What do you call the main part of a joke?

Is there such thing as an Availability Group failover trigger?

Why do we bend a book to keep it straight?

Why are both D and D# fitting into my E minor key?

How to answer "Have you ever been terminated?"



Azure SQL Server - big query choosing bad execution plan



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I'm using Azure SQL Server v12 and I have big, complex query that runs ok but when I add more joins, it doesn't matter which table I'm joining to, it gets super slow. The important thing to point out is that by adding a simple join it's choosing a different execution for the whole query and I receive warning on sort operations that are not performed in the original query.



I cannot post the query or the execution plan but I want to know if someone faced a similar case. My intuition tells me that SQL Server is choosing a bad execution plan because the query is so big that it times out when it tries to pick one.



Should I indicate the join type and index name for each join to keep the original execution plan? is that the best way to go?









share





























    0















    I'm using Azure SQL Server v12 and I have big, complex query that runs ok but when I add more joins, it doesn't matter which table I'm joining to, it gets super slow. The important thing to point out is that by adding a simple join it's choosing a different execution for the whole query and I receive warning on sort operations that are not performed in the original query.



    I cannot post the query or the execution plan but I want to know if someone faced a similar case. My intuition tells me that SQL Server is choosing a bad execution plan because the query is so big that it times out when it tries to pick one.



    Should I indicate the join type and index name for each join to keep the original execution plan? is that the best way to go?









    share

























      0












      0








      0








      I'm using Azure SQL Server v12 and I have big, complex query that runs ok but when I add more joins, it doesn't matter which table I'm joining to, it gets super slow. The important thing to point out is that by adding a simple join it's choosing a different execution for the whole query and I receive warning on sort operations that are not performed in the original query.



      I cannot post the query or the execution plan but I want to know if someone faced a similar case. My intuition tells me that SQL Server is choosing a bad execution plan because the query is so big that it times out when it tries to pick one.



      Should I indicate the join type and index name for each join to keep the original execution plan? is that the best way to go?









      share














      I'm using Azure SQL Server v12 and I have big, complex query that runs ok but when I add more joins, it doesn't matter which table I'm joining to, it gets super slow. The important thing to point out is that by adding a simple join it's choosing a different execution for the whole query and I receive warning on sort operations that are not performed in the original query.



      I cannot post the query or the execution plan but I want to know if someone faced a similar case. My intuition tells me that SQL Server is choosing a bad execution plan because the query is so big that it times out when it tries to pick one.



      Should I indicate the join type and index name for each join to keep the original execution plan? is that the best way to go?







      query-performance execution-plan azure-sql-database





      share












      share










      share



      share










      asked 3 mins ago









      Francisco GoldensteinFrancisco Goldenstein

      1412




      1412






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f235103%2fazure-sql-server-big-query-choosing-bad-execution-plan%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f235103%2fazure-sql-server-big-query-choosing-bad-execution-plan%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Parapolítica Índice Antecedentes El escándalo Proceso judicial Consecuencias Véase...

          How to remove border from elements in the last row?Targeting flex items on the last rowHow to vertically wrap...

          Tecnologías entrañables Índice Antecedentes Desarrollo Tecnologías Entrañables en la...