SHARE
TWEET

Untitled

a guest Apr 18th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. root@localhost:26257/defaultdb> EXPLAIN (ENV, OPT) select i_id from tpcc.item where i_id = 10;
  2.                                                              text
  3. +-----------------------------------------------------------------------------------------------------------------------------+
  4.   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)
  5.  
  6.   CREATE TABLE item (
  7.       i_id INT8 NOT NULL,
  8.       i_im_id INT8 NULL,
  9.       i_name VARCHAR(24) NULL,
  10.       i_price DECIMAL(5,2) NULL,
  11.       i_data VARCHAR(50) NULL,
  12.       CONSTRAINT "primary" PRIMARY KEY (i_id ASC),
  13.       UNIQUE INDEX replicated_idx_0 (i_id ASC) STORING (i_im_id, i_name, i_price, i_data),
  14.       UNIQUE INDEX replicated_idx_1 (i_id ASC) STORING (i_im_id, i_name, i_price, i_data),
  15.       UNIQUE INDEX replicated_idx_2 (i_id ASC) STORING (i_im_id, i_name, i_price, i_data),
  16.       FAMILY "primary" (i_id, i_im_id, i_name, i_price, i_data)
  17.   );
  18.  
  19.   ALTER TABLE tpcc.public.item INJECT STATISTICS '[
  20.       {
  21.           "columns": [
  22.               "i_id"
  23.           ],
  24.           "created_at": "2019-04-08 18:18:45.991732+00:00",
  25.           "distinct_count": 100000,
  26.           "histo_col_type": "",
  27.           "name": "__auto__",
  28.           "null_count": 0,
  29.           "row_count": 100000
  30.       },
  31.       {
  32.           "columns": [
  33.               "i_im_id"
  34.           ],
  35.           "created_at": "2019-04-08 18:18:45.991733+00:00",
  36.           "distinct_count": 10000,
  37.           "histo_col_type": "",
  38.           "name": "__auto__",
  39.           "null_count": 0,
  40.           "row_count": 100000
  41.       },
  42.       {
  43.           "columns": [
  44.               "i_name"
  45.           ],
  46.           "created_at": "2019-04-08 18:18:45.991733+00:00",
  47.           "distinct_count": 100000,
  48.           "histo_col_type": "",
  49.           "name": "__auto__",
  50.           "null_count": 0,
  51.           "row_count": 100000
  52.       },
  53.       {
  54.           "columns": [
  55.               "i_price"
  56.           ],
  57.           "created_at": "2019-04-08 18:18:45.991734+00:00",
  58.           "distinct_count": 9901,
  59.           "histo_col_type": "",
  60.           "name": "__auto__",
  61.           "null_count": 0,
  62.           "row_count": 100000
  63.       },
  64.       {
  65.           "columns": [
  66.               "i_data"
  67.           ],
  68.           "created_at": "2019-04-08 18:18:45.991735+00:00",
  69.           "distinct_count": 100000,
  70.           "histo_col_type": "",
  71.           "name": "__auto__",
  72.           "null_count": 0,
  73.           "row_count": 100000
  74.       }
  75.   ]';
  76.  
  77.   EXPLAIN (ENV, OPT) SELECT i_id FROM tpcc.item WHERE i_id = 10;
  78.   ----
  79.   scan tpcc.public.item
  80.    └── constraint: /1: [/10 - /10]
  81. (77 rows)
  82.  
  83. Time: 1.210904482s
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top