<@U07FJ89LFFB> is there any way to reduce the numb...
# ask-ai
p
@brash-pillow-71627 is there any way to reduce the number of stages (Trino SQL) in the “Suggest Dimension Slices” query generated by GrowthBook?
o
A message from kapa.ai
I apologize, but the knowledge sources provided do not contain enough specific information to answer your question about reducing the number of stages in the "Suggest Dimension Slices" query for Trino SQL in GrowthBook. The documents don't mention Trino SQL or provide details about optimizing the specific query you're asking about. However, I can provide some general information about query optimization in GrowthBook: GrowthBook does offer some ways to optimize queries and improve performance, particularly for large datasets. For example, they have introduced Fact Tables for Enterprise customers, which can significantly reduce the number of rows scanned during experiment analysis [Savings from Fact Metric Optimization](https://docs.growthbook.io/kb/metrics/fact-metric-optimization). If you're experiencing performance issues or looking to optimize your queries, you may want to: 1. Check if you can use Fact Tables to reduce data scans. 2. Review your data source configuration and experiment assignment queries. 3. Consider reaching out to GrowthBook support for specific advice on your setup. For more detailed assistance with your specific Trino SQL query, I recommend contacting GrowthBook support directly or posting your question in their community forum, as they would be best equipped to provide tailored advice for your use case.
p
@brash-pillow-71627 are there any other resources to reduce the complexity of the “Suggest Dimension Slices” query?
o
A message from kapa.ai
Based on the knowledge sources provided, there isn't specific information about reducing the complexity of the "Suggest Dimension Slices" query. However, I can offer some general insights on query optimization in GrowthBook that might be helpful: 1. SQL Templates: GrowthBook allows the use of SQL templates in metric definitions, which can help filter based on experiment duration. This could potentially reduce the complexity of queries. For example:
Copy code
sql select   min(timestamp) timestamp,   session_id,   anonymous_id,   host,   countIf(event = 'page_viewed') page_views from events where timestamp >= '{{ startDate }}'   AND timestamp < '{{ endDate }}' group by session_id, anonymous_id, host having page_views < 2
This approach can help limit the data scanned and potentially reduce query complexity [Linen GrowthBook Forum](https://linen.growthbook.io/t/16717820/also-is-there-any-way-that-i-can-add-the-experiment-filters-). 2. Dimensional Analysis: GrowthBook applies automatic grouping to high-cardinality dimensions. For example, in a country dimension, only the top 20 countries will be shown individually, with the rest grouped into an
(other)
category. This built-in feature might help reduce the complexity of dimension-related queries [GrowthBook's Statistics](https://docs.growthbook.io/statistics/overview#dimensional-analysis). 3. Experiment Dimensions: Using experiment dimensions instead of user dimensions can lead to simpler queries. If you can include the dimension data in your experiment exposure table, it eliminates the need for additional joins, potentially reducing query complexity [Linen GrowthBook Forum](https://linen.growthbook.io/t/18865415/hi-team-i-see-that-there-2-ways-to-add-dimension-which-one-s). While these suggestions might not directly address the "Suggest Dimension Slices" query, they represent general approaches to query optimization in GrowthBook that could be applicable. For more specific advice on your particular query, it would be best to reach out to GrowthBook support or post your question in their community forum.