title: Redshift WLM config: how is unallocated memory used?
body: <p>When you define Redshift query queues, you can assign the proportion of memory allocated to each queue. So for example, if you had 5 queues, you might assign each one of them 20% of the memory. However, you also allowed to allocate the memory such that a portion of it remains unallocated.</p>
  
  <p>In this documentation:
  <a href="http://docs.aws.amazon.com/redshift/latest/dg/cm-c-defining-query-queues.html" rel="noreferrer">http://docs.aws.amazon.com/redshift/latest/dg/cm-c-defining-query-queues.html</a>
  it says,
  <em>"Any unallocated memory is managed by Amazon Redshift and can be temporarily given to a queue if the queue requests additional memory for processing.
  For example, if you configure four queues, you can allocate memory as follows: 20 percent, 30 percent, 15 percent, 15 percent. The remaining 20 percent is unallocated and managed by the service."</em></p>
  
  <p>Earlier in the documentation, it says,
  "If a specific query needs more memory than is allocated to a single query slot, you can increase the available memory by increasing the wlm_query_slot_count parameter. The following example sets wlm_query_slot_count to 10, performs a vacuum, and then resets wlm_query_slot_count to 1."</p>
  
  <p>Is this related to the memory allocation? Can the query slot count adjustment be used to temporarily consume more memory than the whole queue is normally allowed?</p>
  
  <p>I think my question is really about this part of the first quote, "Any unallocated memory is managed by Amazon Redshift and can be temporarily given to a queue <strong>if the queue requests additional memory for processing</strong>."</p>
  
  <p>Does this mean that the user running a query has to specifically request the additional memory? Does this mean that leaving some memory unallocated is of no use unless you make these specific requests?</p>