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
260
0
Share
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
120
All About Insert
chrissaxon
0
190
Generating days between two dates
chrissaxon
0
240
Converting rows to columns and back again
chrissaxon
0
210
Finding the Longest Common Substring & Gestalt Pattern Matching with SQL & PL/SQL
chrissaxon
0
700
DBA Masterclass Application Tuning
chrissaxon
0
3.1k
A Preview of Oracle Database 20c PLSQL Enhancements
chrissaxon
0
280
Why Is the Optimizer Estimating the Wrong Number of Rows?
chrissaxon
0
140
Which Indexes Should I Create?
chrissaxon
0
180
Other Decks in Technology
See All in Technology
「活動」は激変する。「ベース」は変わらない ~ 4つの軸で捉える_AI時代ソフトウェア開発マネジメント
sentokun
0
140
OCI技術資料 : ロード・バランサ 概要 - FLB・NLB共通
ocise
4
27k
20260323_データ分析基盤でGeminiを使う話
1210yuichi0
0
210
Zephyr(RTOS)でOpenPLCを実装してみた
iotengineer22
0
170
40代からのアウトプット ― 経験は価値ある学びに変わる / 20260404 Naoki Takahashi
shift_evolve
PRO
3
540
第26回FA設備技術勉強会 - Claude/Claude_codeでデータ分析 -
happysamurai294
0
280
OPENLOGI Company Profile for engineer
hr01
1
61k
AIエージェント時代に必要な オペレーションマネージャーのロールとは
kentarofujii
0
240
AI時代のIssue駆動開発のススメ
moongift
PRO
0
330
Zephyr(RTOS)でARMとRISC-Vのコア間通信をしてみた
iotengineer22
0
120
RGBに陥らないために -プロダクトの価値を届けるまで-
righttouch
PRO
0
130
Datadog で実現するセキュリティ対策 ~オブザーバビリティとセキュリティを 一緒にやると何がいいのか~
a2ush
0
180
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
How to train your dragon (web standard)
notwaldorf
97
6.6k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
How to Think Like a Performance Engineer
csswizardry
28
2.5k
The Cult of Friendly URLs
andyhume
79
6.8k
We Have a Design System, Now What?
morganepeng
55
8.1k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
[SF Ruby Conf 2025] Rails X
palkan
2
880
The Pragmatic Product Professional
lauravandoore
37
7.2k
The agentic SEO stack - context over prompts
schlessera
0
720
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
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