WeSearch

SOQL Selectivity: Avoiding Full Table Scans on Million-Row Objects

·6 min read · 0 reactions · 0 comments · 13 views
#salesforce#database#performance
SOQL Selectivity: Avoiding Full Table Scans on Million-Row Objects
⚡ TL;DR · AI summary

The article discusses the importance of SOQL selectivity in Salesforce, particularly when dealing with large data volumes. It highlights how non-selective queries can lead to significant performance issues, such as full table scans that drastically increase query execution time. The article also provides strategies for rewriting queries to improve selectivity and maintain performance as data grows.

Key facts
Original article
DEV.to (Top)
Read full at DEV.to (Top) →
Opening excerpt (first ~120 words) tap to expand

try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3948393) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } SapotaCorp Posted on May 24 • Originally published at sapotacorp.vn SOQL Selectivity: Avoiding Full Table Scans on Million-Row Objects #apex A Salesforce org grew from 50,000 Cases to 5 million Cases over four years. Apex code that processed Cases used to complete in 200ms. The same code now takes 30 seconds when it completes at all; sometimes it times out. The team blames "the platform getting slower." The actual cause is almost always SOQL selectivity.

Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from DEV.to (Top)