Managing Spill Files Generated by Queries
ERROR: number of workfiles per query limit exceeded
- Data skew is present in the queried data.
- The amount memory allocated for the query is too low.
You might be able to run the query successfully by changing the query, changing the data distribution, or changing the system memory configuration. You can use the gp_workfile_* views to see spill file usage information. You can control the maximum amount of memory that can used by a query with the Greenplum Database server configuration parameters max_statement_mem, statement_mem, or through resource queues.
- Information about skew and how to check for data skew
- Information about using the gp_workfile_* views
For information about server configuration parameters, see the Greenplum Database Reference Guide. For information about resource queues, see Workload Management with Resource Queues.
If you have determined that the query must create more spill files than allowed by the value of server configuration parameter gp_workfile_limit_files_per_query, you can increase the value of the parameter.