Difference in order of execution and design in SQL Server.
- Thread starter WWGD
- Start date
-
- Tags
- Design Difference Server Sql
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
3 replies · 2K views
Physics news on Phys.org
Discussion
Mentor
- 15,820
- 10,714
No the sql engine constructs an execution tree and decides how to best execute the query.
Some systems have a describe or explain command that will show how the query will be executed and the actual tables it will use.
It can be quite surprising too. As an example you might have built an index table to speed your query only to discover that it’s not being used. This may mean a different index table is needed.
One caveat is it can be a negative to create too many index tables especially in a high performance application where data is added and deleted constantly. Each time you add or drop data the associated index tables needed to be added to or deleted from.
Some systems have a describe or explain command that will show how the query will be executed and the actual tables it will use.
It can be quite surprising too. As an example you might have built an index table to speed your query only to discover that it’s not being used. This may mean a different index table is needed.
One caveat is it can be a negative to create too many index tables especially in a high performance application where data is added and deleted constantly. Each time you add or drop data the associated index tables needed to be added to or deleted from.
Science Advisor
Homework Helper
- 7,912
- 13,227
I guess that is why you do not use many indexes in OLTP setup? I mean, since they do mostly inserts, updates and deletes.jedishrfu said:No the sql engine constructs an execution tree and decides how to best execute the query.
Some systems have a describe or explain command that will show how the query will be executed and the actual tables it will use.
It can be quite surprising too. As an example you might have built an index table to speed your query only to discover that it’s not being used. This may mean a different index table is needed.
One caveat is it can be a negative to create too many index tables especially in a high performance application where data is added and deleted constantly. Each time you add or drop data the associated index tables needed to be added to or deleted from.
Science Advisor
Homework Helper
- 7,912
- 13,227
It seems from doing informal research that SQL Server will not execute queries that are not done in the order : SELECT FROM WHERE GROUP BY HAVING ORDER BY. I get error messages every time I try any query that violates this order sequence.jedishrfu said:No the sql engine constructs an execution tree and decides how to best execute the query.
Some systems have a describe or explain command that will show how the query will be executed and the actual tables it will use.
It can be quite surprising too. As an example you might have built an index table to speed your query only to discover that it’s not being used. This may mean a different index table is needed.
One caveat is it can be a negative to create too many index tables especially in a high performance application where data is added and deleted constantly. Each time you add or drop data the associated index tables needed to be added to or deleted from.
Similar threads
- WWGD
- · Replies 7 ·
- AI and Computer Science
- Replies
- 7
- WWGD
- · Replies 7 ·
- AI and Computer Science
- Replies
- 7
- WWGD
- · Replies 18 ·
- AI and Computer Science
- Replies
- 18
- WWGD
- · Replies 3 ·
- AI and Computer Science
- Replies
- 3
- Pepper Mint
- · Replies 8 ·
- AI and Computer Science
- Replies
- 8
- SlurrerOfSpeech
- · Replies 3 ·
- AI and Computer Science
- Replies
- 3
- WWGD
- · Replies 5 ·
- AI and Computer Science
- Replies
- 5
- WWGD
- · Replies 5 ·
- AI and Computer Science
- Replies
- 5
- Pepper Mint
- · Replies 1 ·
- AI and Computer Science
- Replies
- 1
- WWGD
- · Replies 11 ·
- Computing and Technology
- Replies
- 11