The way that Jensen Huang runs Nvidia is wild: 40 direct reports. No 1:1s. No formal planning cycles. And no status reports.
In a recent interview, he went in-depth on his Leadership style. Every entrepreneur must understand why it works:
So now that Nvidia has far outstripped the market cap of AMD and Intel, I thought this would be a fun story to tell. I spent 6+yrs @ AMD engg in mid to late 2000s helping design the CPU/APU/GPUs that we see today. Back then it was unimaginable for AMD to beat Intel in market-cap (we did in 2020!) and for Nvidia to beat both! In fact, AMD almost bought Nvidia but Jensen wasn’t ready to sell unless he replace Hector Ruiz of AMD as the CEO of the joint company. The world would have looked very different had that happened. Here’s the inside scoop of how & why AMD saw the GPU oppty, lost it, and then won it back in the backdrop of Nvidia’s far more insane trajectory, & lessons I still carry from those heady days:
𝗧𝗼𝗽 𝟮𝟬 𝗦𝗤𝗟 𝗾𝘂𝗲𝗿𝘆 𝗼𝗽𝘁𝗶𝗺𝗶𝘇𝗮𝘁𝗶𝗼𝗻 𝘁𝗲𝗰𝗵𝗻𝗶𝗾𝘂𝗲𝘀
Here is the list of the top 20 SQL query optimization techniques I found noteworthy:
1. Create an index on huge tables (>1.000.000) rows
2. Use EXIST() instead of COUNT() to find an element in the table
3. SELECT fields instead of using SELECT *
4. Avoid Subqueries in WHERE Clause
5. Avoid SELECT DISTINCT where possible
6. Use WHERE Clause instead of HAVING
7. Create joins with INNER JOIN (not WHERE)
8. Use LIMIT to sample query results
9. Use UNION ALL instead of UNION wherever possible
10. Use UNION where instead of WHERE ... or ... query.
11. Run your query during off-peak hours
12. Avoid using OR in join queries
14. Choose GROUP BY over window functions
15. Use derived and temporary tables
16. Drop the index before loading bulk data
16. Use materialized views instead of views
17. Avoid != or <> (not equal) operator
18. Minimize the number of subqueries
19. Use INNER join as little as possible when you can get the same output using LEFT/RIGHT join.
20. For retrieving the same dataset, frequently try to use temporary sources.
Do you know what is 𝗤𝘂𝗲𝗿𝘆 𝗢𝗽𝘁𝗶𝗺𝗶𝘇𝗲𝗿? Its primary function is to determine 𝘁𝗵𝗲 𝗺𝗼𝘀𝘁 𝗲𝗳𝗳𝗶𝗰𝗶𝗲𝗻𝘁 𝘄𝗮𝘆 to execute a given SQL query by finding the best execution plan. The query optimizer works by taking the SQL query as input and analyzing it to determine how best to execute it. The first step is to parse the SQL query and create a syntax tree. The optimizer then analyzes the syntax tree to determine how to run the query.
Next, the optimizer generates 𝗮𝗹𝘁𝗲𝗿𝗻𝗮𝘁𝗶𝘃𝗲 𝗲𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻 𝗽𝗹𝗮𝗻𝘀, which are different ways of executing the same query. Each execution plan specifies the order in which the tables should be accessed, the join methods, and any filtering or sorting operations. The optimizer then assigns a 𝗰𝗼𝘀𝘁 to each execution plan based on the number of disk reads and the CPU time required to execute the query.
Finally, the optimizer 𝗰𝗵𝗼𝗼𝘀𝗲𝘀 𝘁𝗵𝗲 𝗲𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻 𝗽𝗹𝗮𝗻 with the lowest cost as the optimal execution plan for the query. This plan is then used to execute the query.
Check in the image the 𝗼𝗿𝗱𝗲𝗿 𝗶𝗻 𝘄𝗵𝗶𝗰𝗵 𝗦𝗤𝗟 𝗾𝘂𝗲𝗿𝗶𝗲𝘀 𝗿𝘂𝗻.
#technology #softwareengineering #programming #techworldwithmilan #sql
Steve Jobs had his best ideas while walking—this Stanford study explains why...
In 2014, a team of Stanford researchers examined how creativity levels were impacted by walking.
They conducted experiments with 176 participants that placed them in different situations:
• Walking on a treadmill facing a wall
• Walking outside
• Sitting inside facing a wall
• Sitting outside
In each situation, the participants were asked to complete a range of tasks that are typically used to measure creative thinking. For example, a test of "divergent thinking" asked the participants to come up with as many uses as possible for a set of objects.
The results were incredible:
Participants were dramatically more creative while walking than sitting.
In fact, one group of participants who took back-to-back tests, first sitting inside and then walking inside on a treadmill, saw a 60% improvement in creative output while walking vs. sitting!
Walking, indoors or outdoors, had a similar robust positive impact on creative thinking.
The authors concluded, "Many people anecdotally claim they do their best thinking when walking. We finally may be taking a step, or two, toward discovering why."
Many of history's greatest thinkers, entrepreneurs, artists, and athletes have believed in the power of walking.
It's a simple, free tool we can all use to dramatically improve our lives. Schedule more walks into your weeks.
Simple challenge for all of you:
Go for a 30-minute tech-free walk every single day this week.
• No phone
• No music
• No podcasts
• No articles
• No audiobooks
Just you, your thoughts, your gratitude, and the fresh air.
It’s a simple reset that will unlock new creativity and shift your perspective.
"Above all, do not lose your desire to walk. Every day I walk myself into a state of well-being and walk away from every illness. I have walked myself into my best thoughts, and I know of no thought so burdensome that one cannot walk away from it." - Søren Kierkegaard
If you enjoyed this or learned something, follow me @SahilBloom for more in future!
You can now review code 10x faster!
For better or worse, code reviews are part of the job. If you are part of a team, you'll spend hours trying to understand what other people wrote and giving them suggestions on how to improve.
Artificial Intelligence is changing this.
I had an opportunity to test @coderabbitai, a platform focused on changing how we do code reviews. The potential of a tool like this is enormous!
Here is what I did and what I learned:
First, I connected the tool with my GitHub account and gave it access to one of my repositories. @coderabbitai mentions they do not store your code nor use it to train any models.
Second, I opened a pull request with a few changes to the code. That's what kicked off the whole thing.
@coderabbitai reviewed every one of my changes.
We’ve been using linting and static code analysis tools forever, but they are limited and don’t understand the context of your code.
That’s where AI comes in and changes the game!
As expected, the tool gave me line-by-line suggestions for my changes. Look at the attached screenshot. That's a comment from the bot about fixing a potential infinite loop.
The tool reviewed every new commit I pushed to the pull request. The best part is that it keeps the entire feedback history in context, which helps with the quality of the suggestions.
You can also "speak" to the bot by tagging it in one of your comments. I asked it to rewrite one of its suggestions with a different variable name, and it did it.
Something cool that I didn't try is to customize the prompt the bot uses to do its job. Helpful when you want your review to follow a specific template or the bot to have personality.
How much work can we get off our plate if we have a bot as the first line of defense reviewing our code? Even better, how much will our code's quality improve?
These Artificial Intelligence tools are becoming indispensable, but remember, they need supervision. Use them to extend you, not replace you.
You can create a free account and try the tool yourself: https://t.co/AKpSUrPQ6p. They offer a 14-day free trial, but you can use the code MONTHOFF to get an additional month for free.
Thanks to @coderabbitai for reaching out, helping me understand their tool, and sponsoring this post.
Take a moment to appreciate the magic of trade. A free trade is when two parties make an exchange because they both want to, and both wind up better off. Yes, fraud, coercion, and externalities exist, but the vast majority of exchanges are unregretted and positive sum.
In Russia, during the Cold War, hundreds of old steam-engine trains were strategically parked on old tracks as a contingency plan in case the Russian electric grid faced any disruptions. The central Perm region of Russia is home to a unique sight - a train cemetery filled with dozens of steam locomotives from the 20th century, dating as far back as 1936 and as recent as 1956. Over the years, around 140 locomotives were stored there, but as technology advanced, steam engines were gradually replaced by electric power, rendering these reserve trains obsolete. As maintenance on the locomotives ceased, they fell into disrepair, succumbing to rust and overgrown vegetation.
In recent times, some of the abandoned trains have been purchased and removed by Chinese owners, while others have been restored and transformed into exhibits at various museums and memorials. This train cemetery remains as a testament to an era when steam locomotives played a vital role in Russia's transportation infrastructure during the Cold War.