Top Tweets for #LeftJoin
@kamilwojtalak > - Use `leftJoin()` instead of `whereNotIn()`
It's because NOT IN sometimes can't use indexes. However, to speed things up even more, you can use subqueries to avoid LEFT JOINs as well.
Anyway, `EXPLAIN ANALYZE` in Postgres is your best friend in such cases. :)
@kamilwojtalak I discovered this a lot time ago. Leftjoin is really fast and I design my DB so that leftjoin will be easier
Boost Laravel Performance:
My Query Runs 30s Faster!
I replaced `whereNotIn()` with `leftJoin()`
- and my query ran 30 seconds faster.
The table I was searching for had 800k+ records.
Here are 10 quick ways to optimize Laravel queries:
- Use `leftJoin()` instead of `whereNotIn()`
- Faster and more efficient.
- Replace `whereIn()` with `whereExists()`
- Saves memory.
- Select only needed columns (`select()`)
- Avoid `User::all()`.
- Process large data in chunks (`chunk()`)
- Don’t load everything at once.
- Use `pluck()` instead of `get()`
- Faster for a single column.
- Check records with `exists()` instead of `count() > 0`.
- Use `upsert()` instead of `updateOrInsert()`
- Fewer queries.
- Paginate results (`paginate()`)
- Avoid fetching all data.
- Cache frequent queries (`cache()`)
- Reduce database load.
- Avoid eager loading in loops (`load()`)
- Load relationships efficiently.
Every millisecond counts.
Small changes = big performance gains.
:)

Last Seen Hashtags on Sotwe
Most Popular Users

Elon Musk 
@elonmusk
239.3M followers

Barack Obama 
@barackobama
118.5M followers

Cristiano Ronaldo 
@cristiano
114.3M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
98.6M followers

NASA 
@nasa
92M followers

Justin Bieber 
@justinbieber
91.7M followers

KATY PERRY 
@katyperry
89.9M followers

Taylor Swift 
@taylorswift13
83.9M followers

Lady Gaga 
@ladygaga
75.4M followers

Virat Kohli 
@imvkohli
73.3M followers

Kim Kardashian 
@kimkardashian
70.8M followers

YouTube 
@youtube
68.6M followers

Neymar Jr 
@neymarjr
66.3M followers

Bill Gates 
@billgates
65.1M followers

Selena Gomez 
@selenagomez
63M followers

The Ellen Show
@theellenshow
62.1M followers

CNN 
@cnn
61.6M followers

X 
@x
60.6M followers


