A data-driven look at our most divisive and least consequential debates from Coalesce 2023
Benn Stancil, Co-founder of ThoughtSpot, resolves a few hotly debated topics in data using researching queries in Mode.
“If you count the total number of queries in Mode, it’s something like two billion plus. So, in theory, there are a lot of useful insights...”
Benn Stancil, Field CTO and Co-founder of ThoughtSpot, tries to resolve a few hotly debated topics in data using researching queries in Mode, including leading versus trailing commas, whether pie charts are beneficial for data visualization, and if COUNT(*) or COUNT(1) is better.
COUNT(*) versus COUNT(1)
Benn discusses the difference between using COUNT(*) and COUNT(1) in SQL queries. According to online forums and experts, there is virtually no difference between the two. However, when he examined the queries in Mode, a data analysis platform, Benn found that COUNT(*) queries ran slightly faster than COUNT(1) queries across most databases.
"COUNT(*) is slightly faster for the median run times, like 6 seconds versus 7…So, COUNT(*) is slightly better.” However, he notes that despite COUNT(*) being faster, most users preferred COUNT(1).
The use of pie charts in data visualization
Benn examines the use and effectiveness of pie charts in data visualization. Although pie charts have been criticized by some experts, he found that in Mode, reports with pie charts had higher engagement scores than those without.
He explains, "Reports with no charts at all have an engagement score of 100. If you have charts that aren't pie charts, you get this engagement score of 750 or something, so that’s a little bit better. If you add pie charts, one to two, it's even higher. And if you add more than that, it's even higher. So it turns out that pie charts are a pretty good thing." Benn concludes that pie charts, despite their criticism, appear to be an engaging choice in data visualization.
The preference for trailing commas in SQL queries
Benn also explores the usage of leading and trailing commas in SQL queries. Despite finding that leading commas resulted in slightly lower error rates, users overwhelmingly preferred to use trailing commas.
"The more experienced you get, the more we start to do the crazy thing of using both. We can't make up our minds," he observes. Despite the evidence suggesting that leading commas might be more efficient, trailing commas are used more frequently, perhaps due to readability or aesthetic preference.
Benn’s key insights
- Leading commas in SQL queries have a slightly lower error rate than trailing commas, but trailing commas are more commonly used
- Pie charts are used in 4% of charts in Mode, and they have a higher engagement score than other types of charts
- COUNT(*) is slightly faster than COUNT(1) in SQL queries