Skip to content

Instantly share code, notes, and snippets.

@sharonovd
Created March 15, 2019 17:08
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 sharonovd/c4ce42e9a26617d8c22b1fc786c51c8c to your computer and use it in GitHub Desktop.
Save sharonovd/c4ce42e9a26617d8c22b1fc786c51c8c to your computer and use it in GitHub Desktop.
local uuid = require('uuid')
local log = require('log')
box.cfg{}
box.schema.create_space('test', {if_not_exists=true })
box.space.test:create_index('primary', {parts={1,'string'}, if_not_exists=true})
for i = 1,1000000 do
box.space.test:replace({uuid.new():str(), 'test', 'testtesttesttesttesttesttesttesttesttesttesttest'})
end
local clock = require('clock')
local start = clock.time64()
local count = 0ULL
for _, tuple in box.space.test.index.primary:pairs() do
count = count + 1
end
log.info('Scanned %q tuples', count)
log.info('Runned time %q seconds',
tostring(tonumber(clock.time64() - start)/1000000000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment