# Query Execution

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

Yes. SingleStore supports advanced join capabilities and will automatically redistribute data as necessary to complete a query. SingleStore can also take advantage of collocated data across shard keys and reference tables to reduce data movement. See [Distributed Joins](https://docs.singlestore.com/db/v9.1/introduction/distributed-architecture/distributed-joins.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/db/v9.1/create-a-database/other-schema-concepts.md).

***

Modified at: January 20, 2023

Source: [/db/v9.1/introduction/faqs/query-execution/](https://docs.singlestore.com/db/v9.1/introduction/faqs/query-execution/)

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