Home Forums SQL Server 2008 T-SQL (SS2K8) Query spills to tempdb with correct cardinality estimates RE: Query spills to tempdb with correct cardinality estimates

  • Hi Sean,

    yep, your entirely correct, the sort is responsible for the spill to disk.

    And thanks for pointing out that changing the column to a VARCHAR eliminates the spill.

    I also found that leaving the column as an NVARCHAR and only placing 970 records in that table does not result in a spill eithet.

    Maybe I should re-phase my question

    Why can't SQL SERVER put aside enough memory for the sort and avoid the spill to disk, there seems to be an upper limit the memory that can be granted to a query.

    Cheers

    Martin.