Sto tentando di eseguire una query unendo 2 insiemi di dati di grandi dimensioni e sto superando le risorse superate durante l'errore di esecuzione della query. Ho letto che ci sono dei problemi quando si utilizza Join Each e Group Each, ma non ciò che sarebbe una soluzione alternativa.Risorse superate durante l'esecuzione della query
SELECT
year(users.firstseen) as first_year,
month(users.firstseen) as first_month,
DATEDIFF(orders.timestamp,users.firstseen) as days_elapsed,
count(orders.user_key) as count_orders
FROM
[project.orders] as orders
JOIN EACH
[project.users] AS users
ON
orders.user_key = users.user_key
WHERE orders.store = 'ios'
GROUP EACH BY 1,2,3
Edit: le seguenti lavorato:
SELECT
year(users.firstseen) as firstyear,
month(users.firstseen) as firstmonth,
DATEDIFF(orders.timestamp, users.firstseen) as days_elapsed,
COUNT(users.firstseen) AS count_orders FROM [project.orders] as orders
JOIN EACH(SELECT user_key, firstseen FROM [project.users]
WHERE store_key = 'ios') as users ON orders.user_key = users.user_key
GROUP BY firstyear, firstmonth, days_elapsed
ORDER BY firstyear, firstmonth, days_elapsed
questo ha finito per lavorare SELEZIONA anno (users.firstseen) come firstyear, mese (users.firstseen) come firstmonth, DATEDIFF (orders.timestamp, users.firstseen) come days_elapsed, COUNT (users.firstseen) AS count_orders FROM [project.orders] come ordini ISCRIVITI EACH ( SELEZIONA user_key, firstseen dA [project.users] DOVE store_key = 'ios') come utenti ON orders.user_key = users.user_key GROUP BY firstyear, firstmonth, days_elapsed ORDER BY firstyear, firstmonth, days_elapsed – user2388120