This section walks through a few high-level errors you may encounter with Rockset. This section helps you diagnose and fix problems with SQL errors.

When writing SQL queries, you may encounter these common error types:

  • [Resource Exhausted: High Memory Usage](🔗)

  • [Resource Exhausted: VI is too Small](🔗)

  • [Query Deadline Exceeded](🔗)

  • [Query Syntax Issues](🔗)

  • [Query Result Set Too Large](🔗)

  • [Query Error: Collection Doesn’t Exist](🔗)

  • [Query Error: SQL Function Doesn’t Exist](🔗)

  • [Query Error: Not Passing all Parameters](🔗)

  • [Query Error: Passing the Wrong Value in a SQL Function Argument](🔗)

  • [Query Error: Invalid Arguments for SQL Transformations and Rollups](🔗)

Query Results Ordering

Standard JSON itself _**does not**_ guarantee the preservation of key order within objects. The results of your query may not be guaranteed to appear in a specific order. To ensure accuracy and consistency in retrieving data, it is strongly recommended that you explicitly specify the field name rather than relying on the default order in which the results are presented. We **_do_** return an array of column names in the correct order which you can alternatively refer to.

### Resource Exhausted: High Memory Usage

This error occurs if a query has excessively high memory usage.



To address this error, re-write the SQL query to use less memory. The Rockset [Query Performance page](🔗) is a useful resource. If you’re struggling, you can email [[email protected]](🔗) to get more help.

### Resource Exhausted: VI is too Small

This occurs if the number and complexity of queries sent to a [<<glossary:Virtual Instance>>](🔗) exceeds total memory usage limits for that VI's size.



There are four ways to address this error:

  • Increase your VI size to handle your workload.

  • Consider using an [<<glossary:Ingest Transformation>>](🔗) and [<<glossary:Rollups>>](🔗) (where applicable) when you create the [<<glossary:Collection>>](🔗). Since computation happens partially at ingest, transformations and rollups might reduce your computational load and resolve the error.

  • Reduce the rate at which you run queries.

  • Rewrite the query to use less memory (again, the [query performance page](🔗) can be useful for this).

If you can’t resolve the issue, send an email to [[email protected]](🔗).

### Query Deadline Exceeded

Queries have a two-minute deadline for completion, after which an error occurs.



You can fix this error using the four methods described in [Resource Exhausted: VI is too Small](🔗) above.

### Query Syntax Issues



To fix query syntax issues, check the [SQL reference page](🔗) to see if the syntax in the suggested line of code is correct.

### Query Result Set Too Large

This error occurs when a result exceeds 100,000 rows.



To fix result sets that are too large:

  • Set a `LIMIT` clause to limit the number of rows in the results.

  • Use our [Pagination REST API](🔗).

### Query Error: Collection Doesn’t Exist

This error occurs when querying a collection that does not exist.



To address this error:

  • Check whether the collection exists or if there is a typo in the collection name.

  • Make sure you’re using the correct [<<glossary:Workspace>>](🔗) (i.e., `yourWorkspace.collectionName`).

### Query Error: SQL Function Doesn’t Exist

This error occurs when attempting to execute a SQL function that does not exist or contains a typo.



See our [SQL reference page](🔗) to find supported functions.

### Query Error: Not Passing all Parameters

This error occurs if a [<<glossary:Query Lambda>>](🔗) is called without passing all parameters.



Ensure all expected values are passed for the query parameters in the query request. Check the documentation for the appropriate [SDK](🔗) for more details.

### Query Error: Passing the Wrong Value in a SQL Function Argument

This error occurs when the wrong type of value is passed for the SQL function argument.



Ensure you are passing the right data type to the SQL function. Again, our [SQL reference page](🔗) is likely useful for this error.

### Query Error: Invalid Arguments for SQL Transformations and Rollups

This error occurs when running an ingest transformation on a field that does not exist in a collection.



Double check that your ingest transformation SQL references fields that exist in the relevant collection.