using view (necessary) with where conditions (dynamically)Window functions cause awful execution plan when...

Bash script to truncate subject line of incoming email

How do you funnel food off a cutting board?

Is there a lava-breathing lizard creature (that could be worshipped by a cult) in 5e?

How can the probability of a fumble decrease linearly with more dice?

Has Britain negotiated with any other countries outside the EU in preparation for the exit?

Is using an 'empty' metaphor considered bad style?

What makes papers publishable in top-tier journals?

In Linux what happens if 1000 files in a directory are moved to another location while another 300 files were added to the source directory?

Which communication protocol is used in AdLib sound card?

Early credit roll before the end of the film

Does Skippy chunky peanut butter contain trans fat?

Is there a verb that means to inject with poison?

Why does photorec keep finding files after I have filled the disk free space as root?

Square Root Distance from Integers

Why would space fleets be aligned?

How to make ice magic work from a scientific point of view?

Why is Agricola named as such?

False written accusations not made public - is there law to cover this?

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?

I have trouble understanding this fallacy: "If A, then B. Therefore if not-B, then not-A."

TikZ graph edges not drawn nicely

Do "fields" always combine by addition?

How do I append a character to the end of every line in an excel cell?

What language shall they sing in?



using view (necessary) with where conditions (dynamically)


Window functions cause awful execution plan when called from a view with external parametrized 'where' clauseEasily show rows that are different between two tables or queriesExecution plan shows expensive CONVERT_IMPLICIT operation. Can I fix this with indexing or do I need to change the table?View with fallback (performance/optimization question)Creating a View with results from join of scalar tablesJoining two inline functions, slows considerably when filtering on second functionSSAS cube process time increased after making fact and dimension smallGroup by's in materialized views and query planningPoor SQL Server Performance With Nested “OR” Conditions In LEFT OUTER JOINPerformance issues with groupwise MAX in JOIN clause













0















Suppose we have two tables like A {a1, a2, a3 ...} and B{b1, b2, b3 ...}



We are using a MySQl view like



Select a.a1, b.b1 from A a Left JOIN  B b ON a.a2=b.b2 


Now our requirement is that we have to put "where conditions" dynamically on some columns of A and B, so we have to again join table and putting a where condition (In current code).



Now as joining twice is increasing our query execution time and I am trying to reduce the time.



We can't remove the view as per the security requirement (SQL SECURITY).



Is there a way to handle this scenario, I thought of using functions with "SQL SECURITY" or there are any other alternatives.









share







New contributor




Saurabh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    Suppose we have two tables like A {a1, a2, a3 ...} and B{b1, b2, b3 ...}



    We are using a MySQl view like



    Select a.a1, b.b1 from A a Left JOIN  B b ON a.a2=b.b2 


    Now our requirement is that we have to put "where conditions" dynamically on some columns of A and B, so we have to again join table and putting a where condition (In current code).



    Now as joining twice is increasing our query execution time and I am trying to reduce the time.



    We can't remove the view as per the security requirement (SQL SECURITY).



    Is there a way to handle this scenario, I thought of using functions with "SQL SECURITY" or there are any other alternatives.









    share







    New contributor




    Saurabh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      Suppose we have two tables like A {a1, a2, a3 ...} and B{b1, b2, b3 ...}



      We are using a MySQl view like



      Select a.a1, b.b1 from A a Left JOIN  B b ON a.a2=b.b2 


      Now our requirement is that we have to put "where conditions" dynamically on some columns of A and B, so we have to again join table and putting a where condition (In current code).



      Now as joining twice is increasing our query execution time and I am trying to reduce the time.



      We can't remove the view as per the security requirement (SQL SECURITY).



      Is there a way to handle this scenario, I thought of using functions with "SQL SECURITY" or there are any other alternatives.









      share







      New contributor




      Saurabh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Suppose we have two tables like A {a1, a2, a3 ...} and B{b1, b2, b3 ...}



      We are using a MySQl view like



      Select a.a1, b.b1 from A a Left JOIN  B b ON a.a2=b.b2 


      Now our requirement is that we have to put "where conditions" dynamically on some columns of A and B, so we have to again join table and putting a where condition (In current code).



      Now as joining twice is increasing our query execution time and I am trying to reduce the time.



      We can't remove the view as per the security requirement (SQL SECURITY).



      Is there a way to handle this scenario, I thought of using functions with "SQL SECURITY" or there are any other alternatives.







      sql-server mysql view





      share







      New contributor




      Saurabh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      Saurabh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      Saurabh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 min ago









      Saurabh SinghSaurabh Singh

      1011




      1011




      New contributor




      Saurabh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Saurabh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Saurabh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          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
          });


          }
          });






          Saurabh Singh is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230830%2fusing-view-necessary-with-where-conditions-dynamically%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








          Saurabh Singh is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Saurabh Singh is a new contributor. Be nice, and check out our Code of Conduct.













          Saurabh Singh is a new contributor. Be nice, and check out our Code of Conduct.












          Saurabh Singh is a new contributor. Be nice, and check out our Code of Conduct.
















          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%2f230830%2fusing-view-necessary-with-where-conditions-dynamically%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

          Anexo:Material bélico de la Fuerza Aérea de Chile Índice Aeronaves Defensa...

          Always On Availability groups resolving state after failover - Remote harden of transaction...

          update json value to null Announcing the arrival of Valued Associate #679: Cesar Manara ...