-
as seen on SQL Blog
- Search for 'SQL Blog'
The query optimizer does not always choose an optimal strategy when joining partitioned tables. This post looks at an example, showing how a manual rewrite of the query can almost double performance, while reducing the memory grant to almost nothing. Test Data The two tables in this example use…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Just a small question regarding joins. I have a table with around 30 fields and i was thinking about making a second table to store 10 of those fields. Then i would just join them in with the main data. The 10 fields that i was planning to store in a second table does not get queried directly, it's…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Just a small question regarding joins. I have a table with around 30 fields and i was thinking about making a second table to store 10 of those fields. Then i would just join them in with the main data. The 10 fields that i was planning to store in a second table does not get queried directly, it's…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Table 1
Field1 Field2
AA 20
AA 20
AB 12
AC 13
Table2
field3 field4
AA 20
AA 20
AC 13
AD 23
AW 21
output required:
newfield field2 field4
AA 20 20
AA 20 20
AC 13 13
I used:
select field1 as newfield, t1.field2,t2.field4
from table1 t1 join table2 t2 on t1.field1=t2.field3
This…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a program to use the IMDB database and am having very slow performance on my query. It appears that it doesn't use my where condition until after it materializes everything. I looked around for hints to use but nothing seems to work. Here is my query:
SELECT *
FROM name as n1
FULL JOIN…
>>> More