Posts

Showing posts with the label Table Variables deferred compilation

What's New in SQL Server 2019 and Table Variables deferred compilation

Image
Hi guys, Here we are together again to continue the discussion started in the previous article you find here. Previously I told you the history of Table Variables and we have also seen their limits. Today is the time to tell you the news that accompany the release of the 2019 version of SQL Server , starting from the Table Variables . Are you ready? Get comfortable and let's go! Table Variables deferred compilation Let's immediately give a name to the novelty introduced by SQL Server 2019 regarding Table Variables: the Table Variables deferred compilation As the name explains, the compilation of the Table Variables becomes Deferred. Deferred in the sense that it happens not at the moment in which the table is created but is postponed (deferred) at the moment in which the table is used in our Query .  More in detail, the cardinality estimate occurs at the first use, after which no other recompilation will take place . In fact, it is therefore a compromise between recompiling ...

Le Table Variables // Le novità introdotte con SQL Server 2019. (Parte 2)

Image
Cari lettori, Eccoci di nuovo assieme per continuare il discorso inziato nel precedente articolo che trovate Qui In precedenza vi avevo raccontato la storia delle Table Variables ma anche delle loro limitazioni . Ora però è il momento di raccontarvi le novità che accompagnano l'uscita della versione 2019 di SQL Server. Siete pronti? Mettetevi comodi che si parte!   Table Variables deferred compilation   Diamo subito un nome alla novità introdotta da SQL Server 2019 che riguarda le Table Variables: la Table Variables deferred compilation Come spiega il nome la compilazione delle Table Variables diventa Differita. Differita nel senso che avviene non al momento in cui la tabella viene creata bensì viene posticipata (differita) al momento in cui la tabella viene utilizzata nella nostra Query . Più in dettaglio, la stima della cardinalità avviene al primo utilizzo dopodichè non avverrà nessuna altra ricompilazione. Di fatto è quindi un compromesso tra il ricompilar...