10 ms·
I've forgotten more Sql than most people ever learn. Time is also valuable and I make trade-offs. Should I spend hours (eg. $$$) to optimize or run a non-opti
by httparchive 3y ago
I've forgotten more Sql than most people ever learn. Time is also valuable and I make trade-offs. Should I spend hours (eg. $$$) to optimize or run a non-optimized query in the background for a different cost? Well, I didn't think the time/benefit/cost equation favored tuning, if I had known that I'd have spent time on tuning. If you offer something for "free" and then change the cost, and don't have any alerting mechanisms to inefficient queries, it's impossible to evaluate trade offs.
- johnnyo 3y agoCan you post what a $14,000 SQL query looks like? If nothing else, it can be an example in my SQL 101 course.
- dabernathy89 3y agoThis would make a great educational blog post
- anon84873628 3y agoIt's rarely interesting logic that makes it expensive. Because the per-query charge is not based on compute cycles but the amount of data scanned. This is sufficient: `SELECT * FROM super_wide_table_with_lots_of_text WHERE NOT filter_on_partitions_or_clusters` Select * is dangerous because it's a column store. You really need to look at the schema and select only the things you want. And when exploring the data it's important to use sane limits and pull from a single partition.
- httparchive 3y agoHere you go! SELECT page, url, payload FROM `{table}` WHERE page like '%{site_domain}/%' AND url like '%[EXAMPLE.COM]%' --- There's no LIMIT on it b/c I actually need all the results.
- kstrauser 3y ago> Time is also valuable and I make trade-offs. I'd say!