Overview
In this guide, you’ll learn how to use the Oxla database with Web Traffic datasets through various sample queries. These datasets contain essential traffic information, including user activity, device, and browser information. Data Source: https://github.com/ClickHouse/ClickBench .Prerequisite
Ensure you’ve created the Data Storage with the appropriate demo dataset, the Cluster is running, and you’re connected to it using the PostgreSQL client. For more details, refer to the Quickstart - Oxla SaaS page.
Ensure you’ve created the Data Storage with the appropriate demo dataset, the Cluster is running, and you’re connected to it using the PostgreSQL client. For more details, refer to the Quickstart - Oxla SaaS page.
Datasets Structure
Let’s explore the tables and their structures to understand better and fully utilize the Web Traffic dataset.hits Table
hits Table
Attribute Name | Type |
---|---|
watchid | Bigint |
javaenable | Integer |
title | Text |
goodevent | Integer |
eventtime | Timestamp without time zone |
eventdate | Date |
counterid | Integer |
clientip | Integer |
regionid | Integer |
userid | Bigint |
counterclass | Integer |
os | Integer |
useragent | Integer |
url | Text |
referer | Text |
isrefresh | Integer |
referercategoryid | Integer |
refererregionid | Integer |
urlcategoryid | Integer |
urlregionid | Integer |
resolutionwidth | Integer |
resolutionheight | Integer |
resolutiondepth | Integer |
flashmajor | Integer |
flashminor | Integer |
flashminor2 | Text |
netmajor | Integer |
netminor | Integer |
useragentmajor | Integer |
useragentminor | Text |
cookieenable | Integer |
javascriptenable | Integer |
ismobile | Integer |
mobilephone | Integer |
mobilephonemodel | Text |
params | Text |
ipnetworkid | Integer |
traficsourceid | Integer |
searchengineid | Integer |
searchphrase | Text |
advengineid | Integer |
isartifical | Integer |
windowclientwidth | Integer |
windowclientheight | Integer |
clienttimezone | Integer |
clienteventtime | Timestamp without time zone |
silverlightversion1 | Integer |
silverlightversion2 | Integer |
silverlightversion3 | Integer |
silverlightversion4 | Integer |
pagecharset | Text |
Sample Queries
Sample 1: Top 10 Pages by Hits
This query selects the top 10 pages based on the number of hits they received.Sample 2: Find Most Active Regions
This query extracts the most active regions ordered by the total number of hits.Sample 3: Hourly Activity Analysis
This query uses theDATE_TRUNC
function to aggregate user activity by hour.