# NOTE: This _v2 Tinybird pipe is NOT currently in use. To make non-breaking, additive changes to the current Tinybird endpoints, modify the un-suffixed "v1" versions of the pipes instead. The _v2 pipes will be removed in a future release. # The _v2 pipes were added as part of a performance improvement experiment, which has been put on hold. TOKEN "stats_page" READ TOKEN "axis" READ NODE session_data SQL > % SELECT site_uuid, session_id, argMinMerge(device) as device FROM _mv_session_data_v2 WHERE site_uuid = {{ String(site_uuid, 'mock_site_uuid', description="Tenant ID", required=True) }} GROUP BY site_uuid, session_id NODE top_devices SQL > % select device, count() as visits from session_data sd inner join filtered_sessions_v2 fs on fs.session_id = sd.session_id group by device order by visits desc limit {{ Int32(skip, 0) }},{{ Int32(limit, 50) }} TYPE ENDPOINT