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. Ask a follow-up in this thread, or start your own.
3 replies · 2K views
Discussion
Physics news on Phys.org
Mentor
- 15,788
- 10,666
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,842
- 13,164
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,842
- 13,164
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
SQL Server modulo operator to find even numbers
- WWGD
- · Replies 7 ·
- Programming and Computer Science
- Replies
- 7
Amateur Dev Q: Creating Front End for SQL Server DB
- WWGD
- · Replies 18 ·
- Programming and Computer Science
- Replies
- 18
Can't find my Localhost Database Engine for SQL Server
- WWGD
- · Replies 3 ·
- Programming and Computer Science
- Replies
- 3
How has SQL Server not gone the way of the dinosaur?
- SlurrerOfSpeech
- · Replies 3 ·
- Programming and Computer Science
- Replies
- 3
Trouble Connecting to Default Instance in SQL Server 2017 (Win10)
- WWGD
- · Replies 11 ·
- Computing and Technology
- Replies
- 11
SQL Server Configuration Manager missing after Express 2017 install
- WWGD
- · Replies 8 ·
- Computing and Technology
- Replies
- 8
Installing SQL Server Dev Config Manager (Snap in)
- WWGD
- · Replies 1 ·
- Computing and Technology
- Replies
- 1
Understanding SQL Relationships and How to Define Them in SQL Server
- FrankJ777
- · Replies 3 ·
- Programming and Computer Science
- Replies
- 3
Copying Databases between Different Versions of SQL Server
- WWGD
- · Replies 8 ·
- Computing and Technology
- Replies
- 8
Pascal: Order of Execution of Program Statements
- C0nfused
- · Replies 9 ·
- Computing and Technology
- Replies
- 9