Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
86
All About Insert
chrissaxon
0
160
Generating days between two dates
chrissaxon
0
190
Converting rows to columns and back again
chrissaxon
0
190
Finding the Longest Common Substring & Gestalt Pattern Matching with SQL & PL/SQL
chrissaxon
0
590
DBA Masterclass Application Tuning
chrissaxon
0
3.1k
A Preview of Oracle Database 20c PLSQL Enhancements
chrissaxon
0
240
Why Is the Optimizer Estimating the Wrong Number of Rows?
chrissaxon
0
100
Which Indexes Should I Create?
chrissaxon
0
150
Other Decks in Technology
See All in Technology
VCpp Link and Library - C++ breaktime 2025 Summer
harukasao
0
210
新卒3年目の後悔〜機械学習モデルジョブの運用を頑張った話〜
kameitomohiro
0
360
Azure AI Foundryでマルチエージェントワークフロー
seosoft
0
130
Perk アプリの技術選定とリリースから1年弱経ってのふりかえり
stomk
0
120
AWS アーキテクチャ作図入門/aws-architecture-diagram-101
ma2shita
27
9.3k
Clineを含めたAIエージェントを 大規模組織に導入し、投資対効果を考える / Introducing AI agents into your organization
i35_267
4
1.2k
CSS、JSをHTMLテンプレートにまとめるフロントエンド戦略
d120145
0
180
データプラットフォーム技術におけるメダリオンアーキテクチャという考え方/DataPlatformWithMedallionArchitecture
smdmts
4
420
Create a Rails8 responsive app with Gemini and RubyLLM
palladius
0
130
Uniadex__公開版_20250617-AIxIoTビジネス共創ラボ_ツナガルチカラ_.pdf
iotcomjpadmin
0
140
ObsidianをMCP連携させてみる
ttnyt8701
2
140
Amazon ECS & AWS Fargate 運用アーキテクチャ2025 / Amazon ECS and AWS Fargate Ops Architecture 2025
iselegant
12
3.5k
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
184
22k
How STYLIGHT went responsive
nonsquared
100
5.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.8k
Facilitating Awesome Meetings
lara
54
6.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
A better future with KSS
kneath
239
17k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
It's Worth the Effort
3n
184
28k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Embracing the Ebb and Flow
colly
86
4.7k
RailsConf 2023
tenderlove
30
1.1k
Building Adaptive Systems
keathley
43
2.6k
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