Questions tagged [batch-mode]

SQL Server batch-mode execution processes plan operator data in 64KB chunks rather than a row at a time.

6 questions
24
votes
1 answer

What exactly can SQL Server 2014 execute in batch mode?

When a columnstore index is being used in a query SQL Server is able to use batch mode. Documentation is thin on what can run in batch mode and what can't. Please look at the following (motivating) query plan where a surprising number of things…
usr
  • 7,390
  • 5
  • 33
  • 58
12
votes
1 answer

Why does batch mode window aggregate yield arithmetic overflow?

The following query performs a windowed SUM over a columnstore table with 1500 total rows, each of which has the value 0 or 1, and it overflows the INT data type. Why is this happening? SELECT a, p, s, v, m, n, SUM(CASE WHEN n IS NULL THEN 0…
12
votes
1 answer

How to make use of Batch Mode with an UNPIVOT (a loop join)?

I have a query of the following form: SELECT ... FROM ColumnstoreTable cs CROSS APPLY ( SELECT * FROM (VALUES ('A', cs.DataA) , ('B', cs.DataB) , ('C', cs.DataC) ) x(Col0, Col1) ) someValues This takes every row…
boot4life
  • 1,289
  • 1
  • 11
  • 19
8
votes
2 answers

What do the HT* wait types mean? (HTREPARTITION, HTDELETE, ...)

A big query is running right now. The result of a batch mode hash join that spills to disk is streamed into a temp table using select into. The query is showing wait types HTDELETE and HTREPARTITION occasionally. The query is not using columnstore…
usr
  • 7,390
  • 5
  • 33
  • 58
2
votes
1 answer

Does Batch Mode only apply to Agg Functions on ColumnStore Index

Azure SQL Database - Standard Edition (S3 Service Tier) Why does Batch Mode only come into effect when using Aggregate Functions? DROP TABLE IF EXISTS dbo.TransCS CREATE TABLE dbo.TransCS ( Col1 INT ,Col2 AS Col1*2 ) CREATE CLUSTERED…
1
vote
1 answer

Does Postgres have anything analogous to Microsoft SQL Server's Batch Mode?

In traditional usages of Microsoft SQL Server, exactly one row flows from one operator in a query plan to the next. In Batch Mode, huge performance gains are obtained by moving thousands of rows at a time between operators. SQL Server has supported…