:confused: :confused: Hi All,
I am new to SQL Server. I want to know about SQL Query execution and compilation sequence.
Consider the following case:
SELECT A.COL1, B. COL2
FROM TAB1 A
INNER JOIN TAB2 B
ON A.COL5 = B.COL5
WHERE A.COL3 = 'A' AND B.COL3 = 'B'
Now as per my records into TAB1 and TAB2, condition B.COL3 = 'B' can reduse more number of rows then condition A.COL3 = 'A'.
So, please let me know above way to write the query is proper or not in given senario.
It would be great if one can provide the details how Sql Server 2000 compile and execute the query and some relavent data to optimize the performance while writting SQL query.
Thanks in Advance,
JaiCreate an index on TAB1 (COL5, COL3, COL1) and an index on TAB2 (COL5, COL3, COL2)|||:confused: :confused: :confused: Thanks for your reply.
My main query is,
Suppose there are three conditions in WHERE clause like...
SELECT ....
FROM ...
WHERE
CONDITION1 AND CONDITION2 AND CONDITION3
Now as per the data in my DB I know that CONDITION2 will reduce more number of rows then CONDITION1 AND CONDITION3. As will CONDITION1 will reduce more number of rows then CONDITION3 but NOT more then CONDITION2.
So, in such senario, the sequence of the condition mentioned above is proper or not? Is there any specific rule to mention condition in the specific sequence while writting WEHRE clause in T-SQL?
Please help asap.
Thanks in advance.|||This is not your father's oracle ;)
SQL Server does not parse the query from bottom to top like some other products. Simply stated, the optimizer reviews many possible paths, looking at indexes, primary keys, statistics, and a whole slew of other variables and then designs an execution plan.
An article I read recently stated that prior to SQL 7, if the optimizer came up with alternate plans for a given query, it was considered a bug. With the advent of 7 though, the optimizer became nuch more complex.
So ... code your queries using ANSI standard joins, place your conditions in the predicate, and leave the optimization to SQL Server!|||Are you simply looking to see the order in which the query parts are processed (which you can see via the show plan), or are you looking to actively change the order (which is rarely a good idea)?
-PatP
Showing posts with label urgent. Show all posts
Showing posts with label urgent. Show all posts
Monday, March 12, 2012
Query Otimization (Urgent)
Query optymalization
Hello,
Could you tell me where can I found some information about "Query
optymalization in data warehouse"?
I really need this info very urgent
Or could you send me some info ?
Thank you very much
Bartosz CREDIT Morawiec
Hi Bartoz:
What kind of info are u looking 4 exactly? Maybe i can give u a hand on this
ALEJANDRO LEGUIZAMO
Colombia - SQL Server MVP
"Bartosz CREDIT Morawiec" <credit@.tlen.pl> wrote in message
news:c7p4km$cot$1@.atlantis.news.tpi.pl...
> Hello,
> Could you tell me where can I found some information about "Query
> optymalization in data warehouse"?
> I really need this info very urgent
> Or could you send me some info ?
> Thank you very much
> Bartosz CREDIT Morawiec
>
>
|||Uytkownik "Alejandro Leguizamo (MVP)" <aleguizamo2@.hotmail.com> napisa w
wiadomoci news:#2A3yFIOEHA.3492@.TK2MSFTNGP10.phx.gbl...
> Hi Bartoz:
> What kind of info are u looking 4 exactly? Maybe i can give u a hand on
this
> --
Trust me
i have no idea yet what should i include. I'm trying to add as
many information as posible
Just give me a hint
Please 
greetings
Bartosz CREDIT Morawiec
|||Well, it should begin with the design of the DW. Many times the problems in
Performance come from that. You can continue with Aggregation Storage
(MOLAP< ROLAP< HOLAP) and a look to usage based optimization. All this stuff
is from the server side.
What kind of client tool r u sing to access data on the server? Becauseif u
are developing your own ap to acces the info on the server side, (i mean ,
sending your own mdx queries) the history will be completelly different
there.
ALEJANDRO LEGUIZAMO
Colombia - SQL Server MVP
"Bartosz CREDIT Morawiec" <credit@.tlen.pl> wrote in message
news:c7uiee$nts$1@.nemesis.news.tpi.pl...
> Uytkownik "Alejandro Leguizamo (MVP)" <aleguizamo2@.hotmail.com> napisa w
> wiadomoci news:#2A3yFIOEHA.3492@.TK2MSFTNGP10.phx.gbl...
> this
>
> Trust me
i have no idea yet what should i include. I'm trying to add as
> many information as posible
Just give me a hint
Please 
>
> greetings
> Bartosz CREDIT Morawiec
>
Could you tell me where can I found some information about "Query
optymalization in data warehouse"?
I really need this info very urgent
Or could you send me some info ?
Thank you very much
Bartosz CREDIT Morawiec
Hi Bartoz:
What kind of info are u looking 4 exactly? Maybe i can give u a hand on this
ALEJANDRO LEGUIZAMO
Colombia - SQL Server MVP
"Bartosz CREDIT Morawiec" <credit@.tlen.pl> wrote in message
news:c7p4km$cot$1@.atlantis.news.tpi.pl...
> Hello,
> Could you tell me where can I found some information about "Query
> optymalization in data warehouse"?
> I really need this info very urgent
> Or could you send me some info ?
> Thank you very much
> Bartosz CREDIT Morawiec
>
>
|||Uytkownik "Alejandro Leguizamo (MVP)" <aleguizamo2@.hotmail.com> napisa w
wiadomoci news:#2A3yFIOEHA.3492@.TK2MSFTNGP10.phx.gbl...
> Hi Bartoz:
> What kind of info are u looking 4 exactly? Maybe i can give u a hand on
this
> --
Trust me
many information as posible
greetings
Bartosz CREDIT Morawiec
|||Well, it should begin with the design of the DW. Many times the problems in
Performance come from that. You can continue with Aggregation Storage
(MOLAP< ROLAP< HOLAP) and a look to usage based optimization. All this stuff
is from the server side.
What kind of client tool r u sing to access data on the server? Becauseif u
are developing your own ap to acces the info on the server side, (i mean ,
sending your own mdx queries) the history will be completelly different
there.
ALEJANDRO LEGUIZAMO
Colombia - SQL Server MVP
"Bartosz CREDIT Morawiec" <credit@.tlen.pl> wrote in message
news:c7uiee$nts$1@.nemesis.news.tpi.pl...
> Uytkownik "Alejandro Leguizamo (MVP)" <aleguizamo2@.hotmail.com> napisa w
> wiadomoci news:#2A3yFIOEHA.3492@.TK2MSFTNGP10.phx.gbl...
> this
>
> Trust me
> many information as posible
>
> greetings
> Bartosz CREDIT Morawiec
>
Query optymalization
Hello,
Could you tell me where can I found some information about "Query
optymalization in data warehouse"?
I really need this info very urgent
Or could you send me some info ?
Thank you very much
Bartosz CREDIT MorawiecHi Bartoz:
What kind of info are u looking 4 exactly? Maybe i can give u a hand on this
ALEJANDRO LEGUIZAMO
Colombia - SQL Server MVP
"Bartosz CREDIT Morawiec" <credit@.tlen.pl> wrote in message
news:c7p4km$cot$1@.atlantis.news.tpi.pl...
> Hello,
> Could you tell me where can I found some information about "Query
> optymalization in data warehouse"?
> I really need this info very urgent
> Or could you send me some info ?
> Thank you very much
> Bartosz CREDIT Morawiec
>
>|||Uytkownik "Alejandro Leguizamo (MVP)" <aleguizamo2@.hotmail.com> napisa w
wiadomoci news:#2A3yFIOEHA.3492@.TK2MSFTNGP10.phx.gbl...
> Hi Bartoz:
> What kind of info are u looking 4 exactly? Maybe i can give u a hand on
this
> --
Trust me
i have no idea yet what should i include. I'm trying to add as
many information as posible
Just give me a hint
Please 
greetings
Bartosz CREDIT Morawiec|||Well, it should begin with the design of the DW. Many times the problems in
Performance come from that. You can continue with Aggregation Storage
(MOLAP< ROLAP< HOLAP) and a look to usage based optimization. All this stuff
is from the server side.
What kind of client tool r u sing to access data on the server? Becauseif u
are developing your own ap to acces the info on the server side, (i mean ,
sending your own mdx queries) the history will be completelly different
there.
ALEJANDRO LEGUIZAMO
Colombia - SQL Server MVP
"Bartosz CREDIT Morawiec" <credit@.tlen.pl> wrote in message
news:c7uiee$nts$1@.nemesis.news.tpi.pl...
> Uytkownik "Alejandro Leguizamo (MVP)" <aleguizamo2@.hotmail.com> napisa w
> wiadomoci news:#2A3yFIOEHA.3492@.TK2MSFTNGP10.phx.gbl...
> this
>
> Trust me
i have no idea yet what should i include. I'm trying to add as
> many information as posible
Just give me a hint
Please 
>
> greetings
> Bartosz CREDIT Morawiec
>
Could you tell me where can I found some information about "Query
optymalization in data warehouse"?
I really need this info very urgent
Or could you send me some info ?
Thank you very much
Bartosz CREDIT MorawiecHi Bartoz:
What kind of info are u looking 4 exactly? Maybe i can give u a hand on this
ALEJANDRO LEGUIZAMO
Colombia - SQL Server MVP
"Bartosz CREDIT Morawiec" <credit@.tlen.pl> wrote in message
news:c7p4km$cot$1@.atlantis.news.tpi.pl...
> Hello,
> Could you tell me where can I found some information about "Query
> optymalization in data warehouse"?
> I really need this info very urgent
> Or could you send me some info ?
> Thank you very much
> Bartosz CREDIT Morawiec
>
>|||Uytkownik "Alejandro Leguizamo (MVP)" <aleguizamo2@.hotmail.com> napisa w
wiadomoci news:#2A3yFIOEHA.3492@.TK2MSFTNGP10.phx.gbl...
> Hi Bartoz:
> What kind of info are u looking 4 exactly? Maybe i can give u a hand on
this
> --
Trust me
many information as posible
greetings
Bartosz CREDIT Morawiec|||Well, it should begin with the design of the DW. Many times the problems in
Performance come from that. You can continue with Aggregation Storage
(MOLAP< ROLAP< HOLAP) and a look to usage based optimization. All this stuff
is from the server side.
What kind of client tool r u sing to access data on the server? Becauseif u
are developing your own ap to acces the info on the server side, (i mean ,
sending your own mdx queries) the history will be completelly different
there.
ALEJANDRO LEGUIZAMO
Colombia - SQL Server MVP
"Bartosz CREDIT Morawiec" <credit@.tlen.pl> wrote in message
news:c7uiee$nts$1@.nemesis.news.tpi.pl...
> Uytkownik "Alejandro Leguizamo (MVP)" <aleguizamo2@.hotmail.com> napisa w
> wiadomoci news:#2A3yFIOEHA.3492@.TK2MSFTNGP10.phx.gbl...
> this
>
> Trust me
> many information as posible
>
> greetings
> Bartosz CREDIT Morawiec
>
Subscribe to:
Posts (Atom)