Filter by ORDER BY Fields
Tables are sorted by their ORDER BY columns. Filtering on these makes queries much faster. markets:ORDER BY (platform, created_at, id, platform_id)
trades: ORDER BY (platform, trader_id, created_at, id)
Always filter by platform and created_at when possible.
Examples
Common Mistakes
Always Use LIMIT
Avoid loading millions of rows unintentionally—it’s slow and wastes resources.Don’t Overuse FINAL
FINAL forces immediate deduplication and is significantly slower. Use it only for counts/aggregations where exact results matter.
Select Only What You Need
Tier-Specific Tips
Starter Tier
(30 days data, 100K row limit, 100 queries/hr)- Always filter by date:
created_at >= now() - INTERVAL 7 DAY - Keep result sets under 100K rows
- Use
SAMPLEfor approximate results:
Pro & Custom Tiers
- Leverage full historical data
- Still filter by ORDER BY columns for best performance