Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Tuning SQL Date Range Queries
Search
Chris
November 01, 2019
Technology
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Tuning SQL Date Range Queries
Chris
November 01, 2019
More Decks by Chris
See All by Chris
Create reusable SQL expressions with SQL macros
chrissaxon
0
160
All About Insert
chrissaxon
0
210
Generating days between two dates
chrissaxon
0
280
Converting rows to columns and back again
chrissaxon
0
250
Finding the Longest Common Substring & Gestalt Pattern Matching with SQL & PL/SQL
chrissaxon
0
740
DBA Masterclass Application Tuning
chrissaxon
0
3.2k
A Preview of Oracle Database 20c PLSQL Enhancements
chrissaxon
0
300
Why Is the Optimizer Estimating the Wrong Number of Rows?
chrissaxon
0
170
Which Indexes Should I Create?
chrissaxon
0
210
Other Decks in Technology
See All in Technology
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
400
Amazon Quick on DesktopがIAM Identity Centerで動かない理由
yukiogawa
0
160
Adaptive Warehouse を今すぐ導入すべき理由と迷ったときの判断基準
__allllllllez__
0
160
AI-DLCって実際どう? 〜聞きたいこと全部聞いてみる〜
news_it_enj
0
260
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
Omarchy Quattro の日本語設定周り
simosako
2
140
AIに丸投げしないトイル削減 / Eliminating Toil Without Leaving It All to AI
kohbis
4
1.1k
こんなアーキテクチャ図は嫌だ BEYOND THE TIME: 半年後の自分へ贈る15のメッセージ / 15 of Anti-pattern in AWS Architecture Diagrams
naospon
3
300
WAF 運用改善の承認サイクル/SRE_BizReach_MIXI_1
visional_engineering_and_design
2
420
GoにおけるFFIのこれまでとこれから
goccy
5
2.3k
生成AIのテナント制御とシャドーMCP対策 | AIを"止めずに"、情報を守る
yukun
0
140
Webとヘルスデータ
yukukotani
1
370
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
1.9k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
The Mindset for Success: Future Career Progression
greggifford
PRO
0
490
Google's AI Overviews - The New Search
badams
0
1.6k
Everyday Curiosity
cassininazir
0
310
Designing for Timeless Needs
cassininazir
1
470
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
330
Six Lessons from altMBA
skipperchong
29
4.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Leo the Paperboy
mayatellez
9
2.3k
Transcript
Your SQL Office Hours session will begin soon… Tuning SQL
Date Range Queries Chris Saxon @ChrisRSaxon & @SQLDaily https://www.youtube.com/c/TheMagicofSQL https://blogs.oracle.com/sql
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
| Welcome to Ask TOM Office Hours!
Why is select … where col = 'VALUE' and date_value
between to_date ( :st_dt, 'YYYY-MM-DD' ) and to_date ( :en_dt, 'YYYY-MM-DD' ) fast for short date ranges and slooooow for large ones?
How many rows will select … where col = :bind_variable
return? # rows / # distinct or use histogram
How many rows will select … where date_value between to_date
( :st_dt, 'YYYY-MM-DD' ) and to_date ( :en_dt, 'YYYY-MM-DD' ) return? ¯\_(ツ)_/¯
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
| Look at the bind values! (peek)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
| DEMO
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
| • One query may have many "good plans" • The database spots this with adaptive cursor sharing • Dynamic statistics can help improve estimates further • Adaptive plans (12c) can change join type (NL <> HJ) Summary
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
| asktom.oracle.com #MakeDataGreatAgain Ryan McGuire / Gratisography