Skip to content

Instantly share code, notes, and snippets.

@rmloveland
Created January 30, 2020 22:38
Show Gist options
  • Save rmloveland/ca4e8af6caa87ba277f0e66abc365f34 to your computer and use it in GitHub Desktop.
Save rmloveland/ca4e8af6caa87ba277f0e66abc365f34 to your computer and use it in GitHub Desktop.
Version: CockroachDB CCL v19.2.2 (x86_64-apple-darwin14, built 2019/12/11 01:27:47, go1.12.12)
CREATE TABLE salaries (
emp_no INT8 NOT NULL,
salary INT8 NOT NULL,
from_date DATE NOT NULL,
to_date DATE NOT NULL,
CONSTRAINT "primary" PRIMARY KEY (emp_no ASC, from_date ASC),
CONSTRAINT salaries_ibfk_1 FOREIGN KEY (emp_no) REFERENCES employees(emp_no) ON DELETE CASCADE,
INDEX salaries_salary_idx (salary ASC),
INDEX salaries_to_date_idx (to_date ASC),
INDEX salaries_salary_idx1 (salary ASC) STORING (to_date),
FAMILY "primary" (emp_no, salary, from_date, to_date)
);
ALTER TABLE employees.public.salaries INJECT STATISTICS '[
{
"columns": [
"emp_no"
],
"created_at": "2020-01-30 22:05:52.818289+00:00",
"distinct_count": 301542,
"histo_col_type": "INT8",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"salary"
],
"created_at": "2020-01-30 22:05:52.818289+00:00",
"distinct_count": 84756,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"from_date"
],
"created_at": "2020-01-30 22:05:52.818289+00:00",
"distinct_count": 6382,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"to_date"
],
"created_at": "2020-01-30 22:05:52.818289+00:00",
"distinct_count": 6118,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"emp_no"
],
"created_at": "2020-01-30 22:23:57.063245+00:00",
"distinct_count": 301542,
"histo_col_type": "INT8",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"salary"
],
"created_at": "2020-01-30 22:23:57.063245+00:00",
"distinct_count": 84756,
"histo_col_type": "INT8",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"from_date"
],
"created_at": "2020-01-30 22:23:57.063245+00:00",
"distinct_count": 6382,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"to_date"
],
"created_at": "2020-01-30 22:23:57.063245+00:00",
"distinct_count": 6118,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"emp_no"
],
"created_at": "2020-01-30 22:25:00.910528+00:00",
"distinct_count": 301542,
"histo_col_type": "INT8",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"salary"
],
"created_at": "2020-01-30 22:25:00.910528+00:00",
"distinct_count": 84756,
"histo_col_type": "INT8",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"to_date"
],
"created_at": "2020-01-30 22:25:00.910528+00:00",
"distinct_count": 6118,
"histo_col_type": "DATE",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
},
{
"columns": [
"from_date"
],
"created_at": "2020-01-30 22:25:00.910528+00:00",
"distinct_count": 6382,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 2844047
}
]';
CREATE TABLE employees (
emp_no INT4 NOT NULL,
birth_date DATE NOT NULL,
first_name VARCHAR(14) NOT NULL,
last_name VARCHAR(16) NOT NULL,
gender STRING NOT NULL,
hire_date DATE NOT NULL,
CONSTRAINT "primary" PRIMARY KEY (emp_no ASC),
FAMILY "primary" (emp_no, birth_date, first_name, last_name, gender, hire_date),
CONSTRAINT imported_from_enum_gender CHECK (gender IN ('M':::STRING, 'F':::STRING))
);
ALTER TABLE employees.public.employees INJECT STATISTICS '[
{
"columns": [
"emp_no"
],
"created_at": "2020-01-30 22:05:50.305791+00:00",
"distinct_count": 301542,
"histo_col_type": "INT8",
"name": "__auto__",
"null_count": 0,
"row_count": 300024
},
{
"columns": [
"birth_date"
],
"created_at": "2020-01-30 22:05:50.305791+00:00",
"distinct_count": 4743,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 300024
},
{
"columns": [
"first_name"
],
"created_at": "2020-01-30 22:05:50.305791+00:00",
"distinct_count": 1275,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 300024
},
{
"columns": [
"last_name"
],
"created_at": "2020-01-30 22:05:50.305791+00:00",
"distinct_count": 1637,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 300024
},
{
"columns": [
"gender"
],
"created_at": "2020-01-30 22:05:50.305791+00:00",
"distinct_count": 2,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 300024
},
{
"columns": [
"hire_date"
],
"created_at": "2020-01-30 22:05:50.305791+00:00",
"distinct_count": 5389,
"histo_col_type": "",
"name": "__auto__",
"null_count": 0,
"row_count": 300024
}
]';
EXPLAIN (OPT, ENV, VERBOSE) SELECT e.last_name, s.salary FROM (SELECT emp_no, salary FROM salaries WHERE to_date > now() ORDER BY salary DESC LIMIT 25) AS s JOIN employees AS e ON e.emp_no = s.emp_no WHERE s.salary > (SELECT max(salaries.salary) * 0.9 FROM salaries);
----
project
├── columns: last_name:8 salary:2
├── side-effects
├── stats: [rows=8.33333333]
├── cost: 3467032.04
├── prune: (2,8)
└── inner-join (lookup employees)
├── columns: salaries.emp_no:1 salary:2 to_date:4 e.emp_no:5 last_name:8
├── key columns: [1] = [5]
├── side-effects
├── stats: [rows=8.33333333, distinct(1)=8.33328734, null(1)=0, distinct(5)=8.33328734, null(5)=0]
├── cost: 3467031.95
├── fd: (5)-->(8), (1)==(5), (5)==(1)
├── select
│ ├── columns: salaries.emp_no:1 salary:2 to_date:4
│ ├── cardinality: [0 - 25]
│ ├── side-effects
│ ├── stats: [rows=8.33333333, distinct(1)=8.33328734, null(1)=0, distinct(2)=8.33333333, null(2)=0, distinct(4)=8.33013361, null(4)=0]
│ ├── cost: 3466981.27
│ ├── prune: (1)
│ ├── interesting orderings: (-2)
│ ├── limit
│ │ ├── columns: salaries.emp_no:1 salary:2 to_date:4
│ │ ├── internal-ordering: -2
│ │ ├── cardinality: [0 - 25]
│ │ ├── side-effects
│ │ ├── stats: [rows=25, distinct(1)=24.9992702, null(1)=0, distinct(2)=24.9966428, null(2)=0, distinct(4)=24.949319, null(4)=0]
│ │ ├── cost: 3466979.89
│ │ ├── prune: (1)
│ │ ├── interesting orderings: (-2)
│ │ ├── sort
│ │ │ ├── columns: salaries.emp_no:1 salary:2 to_date:4
│ │ │ ├── side-effects
│ │ │ ├── stats: [rows=948015.667, distinct(1)=294957.667, null(1)=0, distinct(2)=84755.8955, null(2)=0, distinct(4)=6118, null(4)=0]
│ │ │ ├── cost: 3466979.63
│ │ │ ├── ordering: -2
│ │ │ ├── prune: (1,2)
│ │ │ ├── interesting orderings: (+1) (+2,+1) (+4,+1)
│ │ │ └── select
│ │ │ ├── columns: salaries.emp_no:1 salary:2 to_date:4
│ │ │ ├── side-effects
│ │ │ ├── stats: [rows=948015.667, distinct(1)=294957.667, null(1)=0, distinct(2)=84755.8955, null(2)=0, distinct(4)=6118, null(4)=0]
│ │ │ ├── cost: 3071570.79
│ │ │ ├── prune: (1,2)
│ │ │ ├── interesting orderings: (+1) (+2,+1) (+4,+1)
│ │ │ ├── scan salaries
│ │ │ │ ├── columns: salaries.emp_no:1 salary:2 to_date:4
│ │ │ │ ├── stats: [rows=2844047, distinct(1)=301542, null(1)=0, distinct(2)=84756, null(2)=0, distinct(4)=6118, null(4)=0]
│ │ │ │ │ histogram(1)= 0 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 568 13935 284 13935 284 13935 284 13935 284 13651 568 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 568 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13651 568 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 568 13935 284 13935 284 13651 568 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13651 568 13935 284 13651 568 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 13935 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 568 13935 284 14220 284 14220 284 14220 284 14220 284 14220 284 14220 284
│ │ │ │ │ <--- 10004 ------- 11194 ------- 12773 ------- 14413 ------- 16201 ------- 17593 ------- 19105 ------- 20187 ------- 21619 ------- 23215 ------- 24310 ------- 25476 ------- 26543 ------- 28352 ------- 29945 ------- 31433 ------- 32649 ------- 33983 ------- 35503 ------- 37090 ------- 38752 ------- 40444 ------- 41621 ------- 43078 ------- 44405 ------- 45776 ------- 47214 ------- 48488 ------- 50280 ------- 51839 ------- 53333 ------- 55335 ------- 56467 ------- 57941 ------- 59501 ------- 61518 ------- 63254 ------- 64526 ------- 66351 ------- 68079 ------- 69658 ------- 70883 ------- 72473 ------- 74113 ------- 75556 ------- 76725 ------- 78377 ------- 79793 ------- 81110 ------- 82549 ------- 83817 ------- 85231 ------- 86515 ------- 88282 ------- 89854 ------- 91324 ------- 92470 ------- 94335 ------- 96302 ------- 97682 ------- 99210 ------- 100582 ------- 101962 ------- 103481 ------- 105095 ------- 106716 ------- 108419 ------- 200064 ------- 201587 ------- 203065 ------- 204382 ------- 205683 ------- 206995 ------- 208821 ------- 210208 ------- 211560 ------- 212933 ------- 214334 ------- 215924 ------- 217145 ------- 218515 ------- 219709 ------- 221631 ------- 222871 ------- 224318 ------- 225593 ------- 227069 ------- 228834 ------- 230481 ------- 231877 ------- 233765 ------- 235446 ------- 237162 ------- 238709 ------- 240457 ------- 242289 ------- 243916 ------- 245355 ------- 246966 ------- 248755 ------- 250357 ------- 252015 ------- 253765 ------- 255314 ------- 256664 ------- 258285 ------- 259871 ------- 261114 ------- 262690 ------- 264224 ------- 265668 ------- 267460 ------- 269104 ------- 270845 ------- 272559 ------- 273743 ------- 275043 ------- 276523 ------- 277727 ------- 279177 ------- 280629 ------- 281809 ------- 283334 ------- 284923 ------- 286199 ------- 287741 ------- 289299 ------- 290583 ------- 291749 ------- 293368 ------- 295012 ------- 296247 ------- 297859 ------- 298920 ------- 400404 ------- 401808 ------- 403255 ------- 404779 ------- 406348 ------- 408065 ------- 409558 ------- 411032 ------- 412630 ------- 413846 ------- 415067 ------- 416427 ------- 417824 ------- 419082 ------- 420352 ------- 422215 ------- 423673 ------- 425270 ------- 426736 ------- 428288 ------- 429760 ------- 431098 ------- 432938 ------- 434713 ------- 436178 ------- 437807 ------- 439254 ------- 441083 ------- 442590 ------- 443948 ------- 446009 ------- 447410 ------- 449064 ------- 450474 ------- 451909 ------- 453476 ------- 455012 ------- 456649 ------- 458358 ------- 459547 ------- 460877 ------- 462407 ------- 464129 ------- 466351 ------- 467584 ------- 468811 ------- 470417 ------- 471950 ------- 473374 ------- 474817 ------- 475985 ------- 477402 ------- 478988 ------- 480694 ------- 482317 ------- 483443 ------- 485025 ------- 486552 ------- 488764 ------- 490242 ------- 492059 ------- 493534 ------- 495470 ------- 496834 ------- 498606 ------- 499992
│ │ │ │ │ histogram(2)= 0 284 13935 284 0 94706 13367 568 13367 284 13367 284 13367 284 13082 568 13367 284 13367 284 13367 284 13367 284 13367 284 13367 284 13367 284 13367 284 13367 284 13082 568 13367 284 13082 568 13082 568 13367 284 13367 568 13367 284 13367 284 13367 284 13367 284 13367 284 13367 284 13367 284 13367 284 13367 284 13082 568 13367 284 13082 568 13367 568 13367 284 13367 284 13367 284 13367 284 13367 568 13367 284 13367 284 13367 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13367 568 13651 284 13651 284 13367 568 13651 284 13651 284 13651 284 13651 568 13367 284 13651 284 13651 284 13651 284 13367 568 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 568 13367 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13367 568 13651 284 13651 284 13651 284 13651 568 13367 284 13651 284 13651 284 13651 284 13367 853 13367 284 13367 568 13651 568 13367 568 13367 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 568 13367 284 13651 284 13651 284 13651 284 13651 284 13651 568 13082 568 13651 284 13651 284 13651 568 13367 284 13651 284 13651 568 13367 568 13367 284 13651 284 13651 284 13651 284 13651 284 13651 568 13367 284 13651 284 13651 284 13651 284 13367 568 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 568 13367 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13367 568 13651 284 13651 284 13651 284 13367 568 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284 13651 284
│ │ │ │ │ <--- 39322 ------- 39986 --- 40000 ------- 40394 ------- 40810 ------- 41169 ------- 41537 ------- 41800 ------- 42051 ------- 42408 ------- 42695 ------- 42917 ------- 43130 ------- 43356 ------- 43574 ------- 43807 ------- 43994 ------- 44160 ------- 44356 ------- 44538 ------- 44867 ------- 45181 ------- 45411 ------- 45651 ------- 45827 ------- 46020 ------- 46211 ------- 46432 ------- 46606 ------- 46802 ------- 46978 ------- 47192 ------- 47382 ------- 47561 ------- 47757 ------- 47989 ------- 48275 ------- 48492 ------- 48702 ------- 48951 ------- 49168 ------- 49334 ------- 49541 ------- 49815 ------- 50057 ------- 50240 ------- 50460 ------- 50672 ------- 50867 ------- 51068 ------- 51284 ------- 51510 ------- 51695 ------- 51913 ------- 52168 ------- 52370 ------- 52650 ------- 52862 ------- 53078 ------- 53230 ------- 53419 ------- 53623 ------- 53782 ------- 53999 ------- 54192 ------- 54386 ------- 54575 ------- 54768 ------- 54925 ------- 55158 ------- 55376 ------- 55614 ------- 55825 ------- 56010 ------- 56147 ------- 56331 ------- 56550 ------- 56754 ------- 56970 ------- 57186 ------- 57411 ------- 57718 ------- 57919 ------- 58152 ------- 58360 ------- 58569 ------- 58896 ------- 59108 ------- 59326 ------- 59554 ------- 59757 ------- 59956 ------- 60168 ------- 60378 ------- 60614 ------- 60816 ------- 61045 ------- 61207 ------- 61411 ------- 61593 ------- 61802 ------- 62015 ------- 62246 ------- 62454 ------- 62653 ------- 62863 ------- 63097 ------- 63416 ------- 63674 ------- 63916 ------- 64164 ------- 64412 ------- 64639 ------- 64867 ------- 65097 ------- 65368 ------- 65576 ------- 65860 ------- 66084 ------- 66336 ------- 66512 ------- 66789 ------- 67096 ------- 67310 ------- 67586 ------- 67819 ------- 68086 ------- 68295 ------- 68537 ------- 68815 ------- 69028 ------- 69341 ------- 69603 ------- 69883 ------- 70154 ------- 70394 ------- 70676 ------- 70968 ------- 71301 ------- 71529 ------- 71818 ------- 72148 ------- 72402 ------- 72705 ------- 73010 ------- 73391 ------- 73720 ------- 74056 ------- 74404 ------- 74730 ------- 75097 ------- 75383 ------- 75761 ------- 76139 ------- 76439 ------- 76703 ------- 77044 ------- 77446 ------- 77859 ------- 78207 ------- 78575 ------- 78968 ------- 79345 ------- 79758 ------- 80255 ------- 80693 ------- 81049 ------- 81570 ------- 82051 ------- 82511 ------- 82986 ------- 83587 ------- 84109 ------- 84627 ------- 85207 ------- 85730 ------- 86290 ------- 86818 ------- 87345 ------- 87862 ------- 88451 ------- 89059 ------- 89696 ------- 90319 ------- 91160 ------- 91793 ------- 92588 ------- 93588 ------- 94514 ------- 95452 ------- 96711 ------- 98027 ------- 99771 ------- 102312 ------- 103674 ------- 105576 ------- 107782 ------- 111139 ------- 115764 ------- 143950
│ │ │ │ │ histogram(4)= 0 284 13935 284 13935 284 13935 568 13935 284 13935 284 13935 284 13651 568 13935 568 13935 284 13935 284 13935 284 13651 568 12798 1422 13935 568 13367 853 13651 853 13651 853 13935 284 13935 568 13935 568 13935 568 13935 568 13935 284 13935 568 13935 284 13651 568 13651 853 13935 284 13935 284 13651 568 13651 568 13651 1137 13651 568 13651 853 13082 1137 13935 853 13651 853 13935 284 13651 1137 13651 568 13651 1137 13651 853 13651 568 13082 1137 13367 1422 13651 568 13651 568 13651 568 13935 284 13367 853 13651 853 13651 568 13935 1137 13935 1137 13935 853 13935 853 13651 568 13367 853 13651 853 13935 284 13367 1137 13935 568 13651 568 13651 853 13367 853 13651 1137 13651 853 13367 853 13651 853 13935 568 13935 284 13935 568 13935 568 13651 853 13935 853 13935 284 13935 1422 13367 1137 13082 1137 13082 1137 12798 1137 13082 853 13367 1137 13367 568 13651 568 13367 568 13367 568 13367 568 13935 284 13651 853 13082 853 13935 853 13651 568 13651 568 12513 1706 13367 1422 13082 853 13651 853 13367 568 13367 1137 13367 1137 13367 1137 12798 1137 13082 853 13082 1137 13082 1137 13367 1137 13651 1137 13651 853 13651 1137 13367 568 13367 568 13651 568 13651 1422 13367 1137 12513 1422 13367 568 12798 1137 13651 568 13367 853 13367 568 13651 284 12798 1137 13367 853 13082 1137 13651 568 13367 853 12513 2275 13082 1137 13651 284 12798 1706 13651 853 13651 568 13367 568 12798 1137 13082 1137 12229 1706 12798 1706 13651 568 13651 284 13367 568 13367 1137 13082 1422 12798 1137 12798 1706 13082 853 13651 1137 12513 1422 13082 1137 12513 1706 13367 568 13651 568 13651 568 13651 284 13651 284 13651 568 13082 853 13651 853 13367 853 13367 568 13367 568 13367 568 13082 1137 13651 853 13651 853 13651 1137 13082 1422 13651 1137 13367 1137 13082 1137 12513 1422 13651 284 13651 284 13367 568 13367 1706 13651 284 13367 568 13082 853 13651 284 13367 853 13367 1706 9669 2.443e+05
│ │ │ │ │ <--- '1985-09-18' ------- '1986-10-06' ------- '1987-04-19' ------- '1987-09-04' ------- '1987-12-26' ------- '1988-04-04' ------- '1988-06-21' ------- '1988-09-08' ------- '1988-12-17' ------- '1989-03-16' ------- '1989-06-05' ------- '1989-08-05' ------- '1989-10-17' ------- '1989-12-07' ------- '1990-02-16' ------- '1990-04-10' ------- '1990-05-26' ------- '1990-07-23' ------- '1990-09-03' ------- '1990-10-25' ------- '1990-12-12' ------- '1991-01-31' ------- '1991-03-24' ------- '1991-05-02' ------- '1991-06-19' ------- '1991-07-29' ------- '1991-09-15' ------- '1991-10-28' ------- '1991-12-15' ------- '1992-02-04' ------- '1992-03-19' ------- '1992-04-26' ------- '1992-06-09' ------- '1992-07-16' ------- '1992-08-27' ------- '1992-10-05' ------- '1992-11-12' ------- '1992-12-23' ------- '1993-02-10' ------- '1993-03-14' ------- '1993-04-20' ------- '1993-05-24' ------- '1993-06-23' ------- '1993-07-30' ------- '1993-08-29' ------- '1993-09-28' ------- '1993-11-01' ------- '1993-12-05' ------- '1994-01-11' ------- '1994-02-15' ------- '1994-03-15' ------- '1994-04-12' ------- '1994-05-10' ------- '1994-06-05' ------- '1994-07-02' ------- '1994-08-02' ------- '1994-09-12' ------- '1994-10-09' ------- '1994-11-08' ------- '1994-12-06' ------- '1995-01-11' ------- '1995-02-02' ------- '1995-03-13' ------- '1995-04-03' ------- '1995-05-01' ------- '1995-05-21' ------- '1995-06-14' ------- '1995-07-16' ------- '1995-08-10' ------- '1995-09-07' ------- '1995-09-30' ------- '1995-11-01' ------- '1995-12-04' ------- '1995-12-28' ------- '1996-02-02' ------- '1996-02-27' ------- '1996-03-26' ------- '1996-04-18' ------- '1996-05-12' ------- '1996-06-07' ------- '1996-07-03' ------- '1996-07-31' ------- '1996-08-24' ------- '1996-09-25' ------- '1996-10-23' ------- '1996-11-20' ------- '1996-12-10' ------- '1997-01-06' ------- '1997-02-03' ------- '1997-02-27' ------- '1997-03-25' ------- '1997-04-17' ------- '1997-05-14' ------- '1997-06-09' ------- '1997-06-27' ------- '1997-07-21' ------- '1997-08-18' ------- '1997-09-12' ------- '1997-10-06' ------- '1997-11-04' ------- '1997-11-24' ------- '1997-12-13' ------- '1998-01-03' ------- '1998-01-26' ------- '1998-02-20' ------- '1998-03-13' ------- '1998-04-07' ------- '1998-04-26' ------- '1998-05-16' ------- '1998-06-12' ------- '1998-07-06' ------- '1998-07-27' ------- '1998-08-17' ------- '1998-09-13' ------- '1998-10-01' ------- '1998-10-25' ------- '1998-11-11' ------- '1998-11-30' ------- '1998-12-20' ------- '1999-01-15' ------- '1999-02-08' ------- '1999-02-28' ------- '1999-03-26' ------- '1999-04-14' ------- '1999-05-06' ------- '1999-05-24' ------- '1999-06-16' ------- '1999-07-10' ------- '1999-07-30' ------- '1999-08-19' ------- '1999-09-14' ------- '1999-10-06' ------- '1999-10-25' ------- '1999-11-12' ------- '1999-12-01' ------- '1999-12-21' ------- '2000-01-18' ------- '2000-02-05' ------- '2000-02-20' ------- '2000-03-12' ------- '2000-03-27' ------- '2000-04-22' ------- '2000-05-14' ------- '2000-05-31' ------- '2000-06-18' ------- '2000-07-06' ------- '2000-07-28' ------- '2000-08-18' ------- '2000-09-06' ------- '2000-09-24' ------- '2000-10-13' ------- '2000-11-03' ------- '2000-11-26' ------- '2000-12-15' ------- '2001-01-07' ------- '2001-01-27' ------- '2001-02-14' ------- '2001-03-10' ------- '2001-03-31' ------- '2001-04-21' ------- '2001-05-12' ------- '2001-05-26' ------- '2001-06-13' ------- '2001-07-04' ------- '2001-07-23' ------- '2001-08-10' ------- '2001-09-02' ------- '2001-09-25' ------- '2001-10-16' ------- '2001-11-04' ------- '2001-11-25' ------- '2001-12-09' ------- '2001-12-30' ------- '2002-01-22' ------- '2002-02-14' ------- '2002-03-05' ------- '2002-03-26' ------- '2002-04-21' ------- '2002-05-15' ------- '2002-06-08' ------- '2002-06-28' ------- '2002-07-18' ------ '9999-01-01'
│ │ │ │ ├── cost: 3043130.31
│ │ │ │ ├── prune: (1,2,4)
│ │ │ │ └── interesting orderings: (+1) (+2,+1) (+4,+1)
│ │ │ └── filters
│ │ │ └── to_date > now() [outer=(4), side-effects, constraints=(/4: (/NULL - ])]
│ │ └── const: 25
│ └── filters
│ └── gt [outer=(2), subquery, constraints=(/2: (/NULL - ])]
│ ├── variable: salary
│ └── subquery
│ └── project
│ ├── columns: "?column?":16
│ ├── cardinality: [1 - 1]
│ ├── stats: [rows=1]
│ ├── cost: 1.12
│ ├── key: ()
│ ├── fd: ()-->(16)
│ ├── scalar-group-by
│ │ ├── columns: max:15
│ │ ├── cardinality: [1 - 1]
│ │ ├── stats: [rows=1]
│ │ ├── cost: 1.09
│ │ ├── key: ()
│ │ ├── fd: ()-->(15)
│ │ ├── scan salaries@salaries_salary_idx,rev
│ │ │ ├── columns: salary:12
│ │ │ ├── limit: 1(rev)
│ │ │ ├── stats: [rows=1]
│ │ │ ├── cost: 1.06
│ │ │ ├── key: ()
│ │ │ └── fd: ()-->(12)
│ │ └── aggregations
│ │ └── const-agg [outer=(12)]
│ │ └── variable: salary
│ └── projections
│ └── max * 0.9 [outer=(15)]
└── filters (true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment