Skip to content

Instantly share code, notes, and snippets.

@sharipov-ru
Created March 26, 2014 11:47
Show Gist options
  • Save sharipov-ru/9781478 to your computer and use it in GitHub Desktop.
Save sharipov-ru/9781478 to your computer and use it in GitHub Desktop.
rethinkdb
# MOVE
# depends on slice set, here is the best results:
# 10K records - 1.2 seconds
# 100K records - 12.0 seconds
db.table('groups').filter(test: 1).run(conn).each_slice(1000) do |group_set|
db.table('archived_groups').insert(group_set).run(conn)
end
# UPDATE
# 10K records - 7 seconds
# 100K records - 62 seconds
db.table('groups').filter(test: 2).update(test: 3).run(conn)
# DESTROY
# 10K records - 0.7 seconds
# 100K records - 3.6 seconds
db.table('archived_groups').filter(test: 4).delete.run(conn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment