Alex Xu Profile picture
Mar 8 9 tweets 3 min read
/1 Want to know the secret to optimizing your SQL queries? Understanding the execution order is key.
/2 SQL statements are executed by the database system in several steps, including:
- Parsing the SQL statement and checking its validity
- Transforming the SQL into an internal representation, such as relational algebra
/3
- Optimizing the internal representation and creating an execution plan that utilizes index information
- Executing the plan and returning the results
/4 The execution of SQL is highly complex and involves many considerations, such as:
- The use of indexes and caches
- The order of table joins
- Concurrency control
- Transaction management
/5 Over to you: The "now()" function in SQL, as used in the statement "SELECT NOW() + 1;", is evaluated during the optimization and execution plan creation step where the function is replaced with the current date and time value before creating the execution plan.
/6
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages):
bit.ly/3FEGliw
/7 I hope you've found this thread helpful.

Follow me @alexxubyte for more.

Like/Retweet the first tweet below if you can:
Also posted the thread on hacker news. Upvote would be appreciated: news.ycombinator.com/newest

Title: Visualizing a SQL Query
If you want to practice SQL, Data Lemur is a great platform. It's similar to Leetcode but for SQL: datalemur.com

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Alex Xu

Alex Xu Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @alexxubyte

Mar 9
/1 The 𝐋𝐢𝐧𝐮𝐱 𝐒𝐭𝐨𝐫𝐚𝐠𝐞 𝐒𝐭𝐚𝐜𝐤 𝐃𝐢𝐚𝐠𝐫𝐚𝐦 shows the layout of the the Linux storage stack. Diagram by Thomas-Krenn. Image
/2 This diagram can be found here: thomas-krenn.com/en/wiki/Linux_… (formats drawio, svg, pdf, png).
/3 Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): blog.bytebytego.com Image
Read 4 tweets
Mar 2
/1 What distinguishes MVC, MVP, MVVM, MVVM-C, and VIPER architecture patterns from each other?

Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): blog.bytebytego.com
/2 These architecture patterns are among the most commonly used in app development, whether on iOS or Android platforms. Developers have introduced them to overcome the limitations of earlier patterns. So, how do they differ?
/3 🔹 MVC, the oldest pattern, dates back almost 50 years
🔹 Every pattern has a "view" (V) responsible for displaying content and receiving user input
🔹 Most patterns include a "model" (M) to manage business data
Read 6 tweets
Mar 1
/1 Almost every software engineer has used Git before, but only a handful know how it works :) Let's dive in. Image
/2 To begin with, it's essential to identify where our code is stored. The common assumption is that there are only two locations - one on a remote server like Github and the other on our local machine. Image
/3 However, this isn't entirely accurate. Git maintains three local storages on our machine, which means that our code can be found in four places:
Read 7 tweets
Feb 28
/1 I read something unbelievable today: Levels. fyi scaled to millions of users using 𝐆𝐨𝐨𝐠𝐥𝐞 𝐒𝐡𝐞𝐞𝐭𝐬 𝐚𝐬 𝐚 𝐛𝐚𝐜𝐤𝐞𝐧𝐝!

They started off on Google Forms and Sheets, which helped them reach millions of monthly active users before switching to a proper backend. Image
/2 To be fair, they do use serverless computing, but using Google Sheets as the database is an interesting choice.

Why do they use Google Sheets as a backend?
/3 Using their own words: "It seems like a pretty counterintuitive idea for a site with our traffic volume to not have a backend or any fancy infrastructure, but our philosophy to building products has always been, start simple and iterate.
Read 7 tweets
Feb 27
/1 What are the API architectural styles?

The diagram below shows the common API architectural styles in one picture:

1. REST
2. GraphQL
3. Web socket
4. Webhook
5. gRPC
6. SOAP
/2 🔹 1. REST
Proposed in 2000, REST is the most used style. It is often used between front-end clients and back-end services. It is compliant with 6 architectural constraints. The payload format can be JSON, XML, HTML, or plain text.
/3 🔹 2. GraphQL
GraphQL was proposed in 2015 by Meta. It provides a schema and type system, suitable for complex systems where the relationships between entities are graph-like.
Read 11 tweets
Feb 23
/1 A beginner’s guide to CDN (Content Delivery Network).

Subscribe to our weekly newsletter to learn something new every week: bit.ly/3FEGliw
/2 CDNs are distributed server networks that help improve the performance, reliability, and security of content delivery on the internet.
/3 Here is the Overall CDN Diagram explains:

Edge servers are located closer to the end user than traditional servers, which helps reduce latency and improve website performance.
Read 8 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(