Created
April 8, 2019 18:40
-
-
Save nvanbenschoten/ef46ae44a04893c23bec88c364730e9b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@localhost:26257/defaultdb> EXPLAIN (ENV, OPT) select i_id from tpcc.item where i_id = 10; | |
text | |
+-----------------------------------------------------------------------------------------------------------------------------+ | |
Version: CockroachDB CCL v19.1.0-beta.20190318-712-g5c2cc21 (x86_64-unknown-linux-gnu, built 2019/04/08 17:20:28, go1.11.6) | |
CREATE TABLE item ( | |
i_id INT8 NOT NULL, | |
i_im_id INT8 NULL, | |
i_name VARCHAR(24) NULL, | |
i_price DECIMAL(5,2) NULL, | |
i_data VARCHAR(50) NULL, | |
CONSTRAINT "primary" PRIMARY KEY (i_id ASC), | |
UNIQUE INDEX replicated_idx_0 (i_id ASC) STORING (i_im_id, i_name, i_price, i_data), | |
UNIQUE INDEX replicated_idx_1 (i_id ASC) STORING (i_im_id, i_name, i_price, i_data), | |
UNIQUE INDEX replicated_idx_2 (i_id ASC) STORING (i_im_id, i_name, i_price, i_data), | |
FAMILY "primary" (i_id, i_im_id, i_name, i_price, i_data) | |
); | |
ALTER TABLE tpcc.public.item INJECT STATISTICS '[ | |
{ | |
"columns": [ | |
"i_id" | |
], | |
"created_at": "2019-04-08 18:18:45.991732+00:00", | |
"distinct_count": 100000, | |
"histo_col_type": "", | |
"name": "__auto__", | |
"null_count": 0, | |
"row_count": 100000 | |
}, | |
{ | |
"columns": [ | |
"i_im_id" | |
], | |
"created_at": "2019-04-08 18:18:45.991733+00:00", | |
"distinct_count": 10000, | |
"histo_col_type": "", | |
"name": "__auto__", | |
"null_count": 0, | |
"row_count": 100000 | |
}, | |
{ | |
"columns": [ | |
"i_name" | |
], | |
"created_at": "2019-04-08 18:18:45.991733+00:00", | |
"distinct_count": 100000, | |
"histo_col_type": "", | |
"name": "__auto__", | |
"null_count": 0, | |
"row_count": 100000 | |
}, | |
{ | |
"columns": [ | |
"i_price" | |
], | |
"created_at": "2019-04-08 18:18:45.991734+00:00", | |
"distinct_count": 9901, | |
"histo_col_type": "", | |
"name": "__auto__", | |
"null_count": 0, | |
"row_count": 100000 | |
}, | |
{ | |
"columns": [ | |
"i_data" | |
], | |
"created_at": "2019-04-08 18:18:45.991735+00:00", | |
"distinct_count": 100000, | |
"histo_col_type": "", | |
"name": "__auto__", | |
"null_count": 0, | |
"row_count": 100000 | |
} | |
]'; | |
EXPLAIN (ENV, OPT) SELECT i_id FROM tpcc.item WHERE i_id = 10; | |
---- | |
scan tpcc.public.item | |
└── constraint: /1: [/10 - /10] | |
(77 rows) | |
Time: 1.210904482s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment