SQL Flow Field Guide

TABLE HINT SPATIAL_WINDOW_MAX_CELLS = <integer_value>

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

Specifies the maximum number of cells to use for tessellating a geometry or geography object.

What changes

Input
none
Output or change
none

Syntax at a glance

WITH ( SPATIAL_WINDOW_MAX_CELLS = <integer_value> )

Work example

A measured query issue may justify testing TABLE HINT SPATIAL_WINDOW_MAX_CELLS = <integer_value> against the optimizer's default choice.

Capture the current plan, rows, reads, and elapsed time. Change one hint in a test copy and compare the same parameter values.

Check your work TABLE HINT SPATIAL_WINDOW_MAX_CELLS = <integer_value>. The intended plan behavior for TABLE HINT SPATIAL_WINDOW_MAX_CELLS = <integer_value> is visible and the result rows are unchanged across the comparison.

Open Microsoft Learn for full syntax, permissions, and details for your version.