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
170
All About Insert
chrissaxon
0
220
Generating days between two dates
chrissaxon
0
290
Converting rows to columns and back again
chrissaxon
0
260
Finding the Longest Common Substring & Gestalt Pattern Matching with SQL & PL/SQL
chrissaxon
0
750
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
180
Which Indexes Should I Create?
chrissaxon
0
220
Other Decks in Technology
See All in Technology
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
480
Running Kotlin + Quarkus with Lambda
nealle
1
3.7k
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
120
"優秀な誰か"の下位互換にならないために
yut0naga1_fa
1
1.8k
Rust で関数型ドメインモデリング
takonda
0
140
Tofu-Controller lightning talk @ Containerday 2026
gionn
0
110
分析AIエージェントを育てる、動く環境を育てる
codatum
1
1.1k
hackers_champloo_2026_tidb
makocchi
0
160
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
300
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
110
Refining Active Record
shugo
0
160
Browser Spec: Testing Hotwire with Ruby
takahashim
1
120
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
The Limits of Empathy - UXLibs8
cassininazir
2
720
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Building Applications with DynamoDB
mza
96
7.2k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Designing for Timeless Needs
cassininazir
1
530
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
Discover your Explorer Soul
emna__ayadi
2
1.3k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
780
Build your cross-platform service in a week with App Engine
jlugia
234
19k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
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