using view (necessary) with where conditions (dynamically)Window functions cause awful execution plan when...
Is "the fire consumed everything on its way" correct?
Am I a Rude Number?
I have trouble understanding this fallacy: "If A, then B. Therefore if not-B, then not-A."
Limits of a density function
Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act (2019 S.130)?
How do you voice extended chords?
How to find the order of a symmetric group S4?
What is a DAG (Graph Theory)?
Is there any risk in sharing info about technologies and products we use with a supplier?
Plausible reason for gold-digging ant
Do authors have to be politically correct in article-writing?
Strange "DuckDuckGo dork" takes me to random website
How do you catch Smeargle in Pokemon Go?
A curious equality of integrals involving the prime counting function?
How does Leonard in "Memento" remember reading and writing?
Removing whitespace between consecutive numbers
Has any human ever had the choice to leave Earth permanently?
Existence of Riemann surface, holomorphic maps
Identify KNO3 and KH2PO4 at home
Why does photorec keep finding files after I have filled the disk free space as root?
Building an exterior wall within an exterior wall for insulation
Saint abbreviation
Explanation of a regular pattern only occuring for prime numbers
Does diversity provide anything that meritocracy does not?
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
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.
mysql view
New contributor
add a comment |
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.
mysql view
New contributor
What MySQL version? What are the indexes on A,B? What does yourEXPLAIN {query}
show?
– danblack
1 min ago
add a comment |
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.
mysql view
New contributor
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.
mysql view
mysql view
New contributor
New contributor
edited 1 min ago
danblack
1,8611213
1,8611213
New contributor
asked 5 mins ago
Saurabh SinghSaurabh Singh
1012
1012
New contributor
New contributor
What MySQL version? What are the indexes on A,B? What does yourEXPLAIN {query}
show?
– danblack
1 min ago
add a comment |
What MySQL version? What are the indexes on A,B? What does yourEXPLAIN {query}
show?
– danblack
1 min ago
What MySQL version? What are the indexes on A,B? What does your
EXPLAIN {query}
show?– danblack
1 min ago
What MySQL version? What are the indexes on A,B? What does your
EXPLAIN {query}
show?– danblack
1 min ago
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
What MySQL version? What are the indexes on A,B? What does your
EXPLAIN {query}
show?– danblack
1 min ago