Skip to main content

BigQuery smart prompting framework on Julius

1. Always include time boundaries

Why this matters: Tables can contain years of data. Without time limits, Julius might scan everything.
Costly approach: “What are our sales trends?”
Cost-effective approach: “Show me daily sales trends for the past 3 months”
Why it’s better: The first query forces Julius to scan the entire sales history (potentially years of data). The second query uses date partitioning to scan only 3 months of data - potentially reducing processing by 80-90%. Pro tip: Start with recent data for exploration, then expand timeframes only when needed.

2. Be specific about what you need

Why this matters: Julius will include relevant columns and metrics based on your request. Vague requests lead to broader data pulls.
Costly approach: “Analyze our customer data”
Cost-effective approach: “Show me customer purchase frequency and average order value for active customers in Q4”
Why it’s better: The first query might pull every customer attribute across all time periods. The second targets specific metrics (purchase frequency, AOV) for a defined segment (active customers) in a specific period (Q4). This could reduce data processing by 70-95%.

3. Use smart sampling for exploration

Why this matters: When you’re exploring patterns or testing hypotheses, perfect precision often isn’t necessary.
Costly approach: “What patterns do you see in user behavior?”
Cost-effective approach: “Analyze login patterns and session duration using a 20% sample of users from the past month”
Why it’s better: The first query processes every user interaction ever recorded. The second processes only 20% of recent data, which is typically sufficient for pattern recognition and costs 80% less while still providing statistically valid insights.

4. Layer your analysis

Why this matters: Start broad with cost-effective queries, then drill down based on what you discover.
Costly approach: “Give me a complete breakdown of all our metrics by every possible dimension”
Cost-effective approach: “Show me our top 5 product categories by revenue this quarter, then I’ll dive deeper into the most interesting one”
Why it’s better: The first approach processes massive amounts of data upfront. The layered approach finds the most important areas first (small data scan), then focuses detailed analysis only where it matters most.

5. Reference existing summaries when available

Why this matters: We have pre-computed summary tables and views that contain aggregated data.
Costly approach: “What’s our monthly revenue growth?”
Cost-effective approach: “Using our monthly_revenue_summary table, show me growth rates for the past year”
Why it’s better: The first query might aggregate daily transaction data from scratch. The second uses pre-computed monthly summaries, processing 12 rows instead of potentially millions.

Quick check: The smart prompting checklist

Before submitting your query, check:
  • Time Range: Did you specify when? (past month, Q4, last 90 days)
  • Scope: Are you asking for specific metrics or segments?
  • Purpose: Is this exploration (use sampling) or precision analysis?
  • Building Blocks: Can you start with a summary or build on previous work?

Reach out to team@julius.ai for support or to ask questions not answered in our documentation.