# Query Optimization

* Column statistics are now automatically gathered on rowstore tables. This is in addition to column statistics being automatically gathered on columnstore tables, which was done previously.
* Range statistics (histograms) are now automatically gathered on columnstore and rowstore tables.
* Rowstore table sampling has been improved.
* Now, a true row-level random sample of rows from columnstore tables is maintained automatically and used to estimate the selectivity of complex predicates.
* All shapes of bushy joins are now supported.
* Common Table Expressions (CTEs) can now be materialized; redundant expressions can use cached data instead of being recomputed.

***

Modified at: February 22, 2023

Source: [/db/v9.1/release-notes/singlestore-memsql/7-0-release-notes/query-optimization/](https://docs.singlestore.com/db/v9.1/release-notes/singlestore-memsql/7-0-release-notes/query-optimization/)

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