Skip to content

Instantly share code, notes, and snippets.

@nirbhayc
Created August 19, 2020 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nirbhayc/85afa5b593128b9fb75213de49be22fe to your computer and use it in GitHub Desktop.
Save nirbhayc/85afa5b593128b9fb75213de49be22fe to your computer and use it in GitHub Desktop.
cdb2sql> create table t1(i int)$$
[create table t1(i int)] rc 0
cdb2sql> insert into t1 select * from generate_series(1,10);
(rows inserted=10)
[insert into t1 select * from generate_series(1,10)] rc 0
$ comdb2sql -cost nctdb "select * from t1 order by 1"
(i=1)
(i=2)
(i=3)
(i=4)
(i=5)
(i=6)
(i=7)
(i=8)
(i=9)
(i=10)
------------------
nctdb:
total time: 6 ms
connections: 1
query: " select * from t1 order by 1"
time 6ms
rows 10
cost 23
table t1 finds 1 next/prev 10 [TABLE SCAN]
temp index next/prev 10 writes 10
Please see {WIKI COMDB2/QUERYCOST<go>} for an explanation
Run your query with 'comdb2sqlexplain' to see the full query plan
------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment