# Query Execution

## Can I JOIN multiple sharded tables in a query?

Yes. SingleStore Helios supports advanced join capabilities and will automatically redistribute data as necessary to complete a query. SingleStore Helios can also take advantage of collocated data across shard keys and reference tables to reduce data movement. See [Query Execution](https://docs.singlestore.com/cloud/getting-started-with-singlestore-helios/about-singlestore-helios/query-execution.md).

## Can I optimize a distributed join involving a small, static table?

Yes, a small table which does not change frequently can be made into a reference table, which is replicated to all the leaf nodes. This ensures that the table does not need to be moved when joined against, at the cost of using more memory. See [Distributed SQL](https://docs.singlestore.com/cloud/create-a-database/other-schema-concepts.md).

## Why do I sometimes receive an ERROR 1227 when running a query?

The following error will be displayed if you do not have the requisite privileges to run a query:

`ERROR 1227 ER_SPECIFIC_ACCESS_DENIED_ERROR: Access denied; you need (at least one of) the SUPER privilege(s) for this op`

This [error is expected](https://docs.singlestore.com/cloud/reference/sql-reference/security-management-commands/grant.md) for SingleStore Helios users when the query involves updating either global or engine variables. Please contact [SingleStore Support](https://support.singlestore.com) if you need to update these variables.

If this error is encountered when running a query that does *not* involve global or engine variables, please contact  [SingleStore Support](https://support.singlestore.com) to help troubleshoot the cause.

***

Modified at: January 20, 2023

Source: [/cloud/getting-started-with-singlestore-helios/about-singlestore-helios/singlestore-helios-faqs/query-execution/](https://docs.singlestore.com/cloud/getting-started-with-singlestore-helios/about-singlestore-helios/singlestore-helios-faqs/query-execution/)

(An index of the documentation is available at /llms.txt)
