Estimating memory needed for sorting
To calculate the amount of virtual shared memory that the database server might need for sorting, estimate the maximum number of sorts that might occur concurrently and multiply that number by the average number of rows and the average row size.
30 sorts * 200 bytes * 400 rows = 2,400,000 bytes
The minimum and default value of DS_NONPDQ_QUERY_MEM is 128 kilobytes. The maximum supported value is 25 percent of DS_TOTAL_MEMORY. For more information, see Configuring memory for queries with hash joins, aggregates, and other memory-intensive elements.
0
, the maximum
amount of shared memory that the database server allocates for a sort
is controlled by the memory grant manager (MGM). The MGM uses the
settings of PDQ priority and the following configuration parameters
to determine how much memory to grant for the sort: - DS_TOTAL_MEMORY
- DS_MAX_QUERIES
- MAX_PDQPRIORITY
For more information about allocating memory for parallel processing, see The allocation of resources for parallel database queries.