I have multiple large views (+50M rows) in my star...
# questions-and-troubleshooting
c
I have multiple large views (+50M rows) in my starrocks database and a customer table (+20M rows for example). I need to extract multiple insights from those views, joining with the customer table, by a specific field (user_id, for example). Both the customer table and my views are distributted by the user_id field. Actually, Im running 8 queries in paralell using nodejs but the total time is around 70 seconds. What tips could you give me to speed up the performance?
u
Hi @Cristiano Sarmento, two suggestions for the performance issue: • MV over View — Views recalculate on every query. Materialized Views store pre-computed results, avoiding repeated joins across your 8 parallel queries. • Colocate Join — Both tables distribute by
user_id
, so adding them to the same Colocate Group enables local joins (no data shuffle), which is a big win for large table joins. or if you can get more detail from query_profile
Copy code
SET enable_profile = true;
SELECT get_query_profile(last_query_id());

--or using
EXPLAIN ANALYZE SELECT ...;
❤️ 2
👍 1
c
thank you, I will test your tips