Categories
SQL

Performance Considerations using APPLY

In the previous post we looked at how to use the CROSS APPLY and OUTER APPLY operators as alternative to a JOIN in queries with some examples. As we wrapped that up I also mentioned that there can be drawbacks to using APPLY in our queries, particularly when we’re working with large data sets. The issue is due to the way that the right hand […]

Categories
SQL

Using Cross Apply and Outer Apply

When joining data in SQL we have a number of options to us including INNER and OUTER joins, but one of the ones I tend to use less frequently is the APPLY operator, specifically the CROSS APPLY and OUTER APPLY operators. As with other types of joins they operate slightly differently and have considerations which should be taken into account when deciding on the output […]

Categories
SQL

Complex Updates and Deletes

The UPDATE and DELETE statements allow us to manage the data within our databases and being able to use them effectively is key. There was recently a question from a junior developer asking about how to perform data changes when table joins are required so I thought it a good opportunity to put forward some more thought out details […]

Categories
SQL Server

Partition Elimination in SQL Server

Back in our introduction to partitioning I’d mentioned that using partitions can also bring us benefits in terms of performance. That performance comes in the way of partition elimination with our queries. Before we get started let’s set the stage with a sample table and one million records of data which we’ve used before: What is partition elimination Partition […]

Categories
Personal

2022 Year in Review

Happy new year folks! I hope everyone enjoyed the festive period and was able to get some sort of a break to spend time with those closest to you. This past year has been a busy one personally and quite a journey with this blog too. With that in mind I thought it was worth […]