Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2025 11:25 AM
HI @Sainath368 and @Waldar , Please find the below table which shows the difference between each queries which are causing the difference in counts and when to use which one.
Query Type Accuracy Based On Why It Differs
| SELECT DISTINCT | Exact | ✅ | Full table scan | Real values |
| approx_count_distinct() | Approximate | ~98% | Runtime estimation | Probabilistic algorithm |
| DESCRIBE EXTENDED | Approximate or Stale | ❌ | Cached metadata | Sampled/stale or not run at all |
Purpose Use This
| Data profiling / Reporting | SELECT COUNT(DISTINCT col) |
| Fast estimate | approx_count_distinct(col) |
| Metadata for query planning | ANALYZE TABLE + DESCRIBE EXTENDED |