Finding query bottlenecks - Deepstash

Explore the World's Best Ideas

Join today and uncover 100+ curated journeys from 50+ topics. Unlock access to our mobile app with extensive features.

Finding query bottlenecks

Finding query bottlenecks

Review your API endpoints and views for:

  • Duplicate queries
  • Slow queries
  • ORM calls that resolve more queries than you expect

3

49 reads

MORE IDEAS ON THIS

Tips to reduce query bottlenecks

Tips to reduce query bottlenecks

  1. Reduce number of queries
  2. Speed up common queries
  3. Cache results of heavy queries
  4. Turn off ATOMIC_REQUESTS -- This settings makes all queries run in a transaction. Read Django docs before changing it to...

3

33 reads

Reduce number of queries

Reduce number of queries

  • Use select_related() to retrieve Foreign Key relations in the same query.
  • Use prefetch_related() for many-to-many and many-to-one relations.
  • Re-use query results across the lifetime of the request if you need them in more pla...

3

24 reads

Speed up common queries

Speed up common queries

  • Add indexes on fields you frequently filter/sort on.
  • Analyze query plans generated by common queries and identify bottlenecks.
  • Rewrite queries to return smaller results sets when possible.
  • Re-model data

3

11 reads

CURATED FROM

CURATED BY

ocpodariu

Alt account of @ocp. I use it to stash ideas about software engineering

📖 Two Scoops of Django

More like this

Your expectations

Don't expect your partner to think like you. It's important that you give your partner room to have their own opinions and views without trying to change them or manipulate them to your way of thinking. 

An effective partnership is really about voluntarily becoming a team because yo...

Regroup when you slow down

Regroup when you slow down

Regroup When You Slow Down




When the afternoon brain fog hits, it's often just because of our natural circadian rhythm.

First, take a break. Get a snack or a power nap if you can.

3. Superior UX saves your business time

By having a superior website UX design you can save time for both yourself and potential clients:

  • Strategically located FAQ pages to address common queries
  • Chatbot software to manage initial user questions
  • A straightforward path down the sales funnel to take payments th...

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving & library

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Personalized recommendations

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates