<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKRTree/queryReserve",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKRTree(py)queryReserve"
  },
  "title" : "queryReserve"
}
-->

# queryReserve

The number of elements to reserve space for when searching.

```
var queryReserve: Int { get set }
```

## Discussion

Use this property to optimize for search speed at the cost of memory usage during a search. With the default value of `1`, when you use the [`elements(inBoundingRectMin:rectMax:)`](/documentation/GameplayKit/GKRTree/elements(inBoundingRectMin:rectMax:)) method, the tree examines potential search results one at a time. If you specify a larger number, the tree allocates additional memory to process several elements together when searching.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)