Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Tuning SQL Date Range Queries
Search
Chris
November 01, 2019
Technology
0
260
Tuning SQL Date Range Queries
Chris
November 01, 2019
Tweet
Share
More Decks by Chris
See All by Chris
Create reusable SQL expressions with SQL macros
chrissaxon
0
100
All About Insert
chrissaxon
0
170
Generating days between two dates
chrissaxon
0
210
Converting rows to columns and back again
chrissaxon
0
200
Finding the Longest Common Substring & Gestalt Pattern Matching with SQL & PL/SQL
chrissaxon
0
660
DBA Masterclass Application Tuning
chrissaxon
0
3.1k
A Preview of Oracle Database 20c PLSQL Enhancements
chrissaxon
0
260
Why Is the Optimizer Estimating the Wrong Number of Rows?
chrissaxon
0
130
Which Indexes Should I Create?
chrissaxon
0
170
Other Decks in Technology
See All in Technology
[2025-12-12]あの日僕が見た胡蝶の夢 〜人の夢は終わらねェ AIによるパフォーマンスチューニングのすゝめ〜
tosite
0
130
普段使ってるClaude Skillsの紹介(by Notebooklm)
zerebom
8
2k
AWS運用を効率化する!AWS Organizationsを軸にした一元管理の実践/nikkei-tech-talk-202512
nikkei_engineer_recruiting
0
160
Strands Agents × インタリーブ思考 で変わるAIエージェント設計 / Strands Agents x Interleaved Thinking AI Agents
takanorig
4
1.8k
マイクロサービスへの5年間 ぶっちゃけ何をしてどうなったか
joker1007
18
7.4k
Lookerで実現するセキュアな外部データ提供
zozotech
PRO
0
190
ZOZOの独自性を生み出す「似合う4大要素」の開発サイクル
zozotech
PRO
0
120
Amazon Connect アップデート! AIエージェントにMCPツールを設定してみた!
ysuzuki
0
130
Kiro を用いたペアプロのススメ
taikis
4
1.6k
松尾研LLM講座2025 応用編Day3「軽量化」 講義資料
aratako
0
350
ESXi のAIOps だ!2025冬
unnowataru
0
290
1人1サービス開発しているチームでのClaudeCodeの使い方
noayaoshiro
2
570
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
120
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Abbi's Birthday
coloredviolet
0
3.6k
AI: The stuff that nobody shows you
jnunemaker
PRO
1
8
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Speed Design
sergeychernyshev
33
1.4k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
170
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
400
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
BBQ
matthewcrist
89
9.9k
How STYLIGHT went responsive
nonsquared
100
6k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
92
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