Skip to content

Commit

Permalink
feat: bulk insert 50000 records (pingcap#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mini256 committed Jul 22, 2024
1 parent 0e6bf3d commit f4ae5be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions etl/lib/importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,16 @@ def import!

def upsert_all
puts "start insert #{events.count} records into DB using upsert_all ..."
events.each_slice(3000) do |es|
puts 'bulk insert 3000 records'
events.each_slice(50000) do |es|
puts 'bulk insert 50000 records'
GithubEvent.upsert_all(es)
end
end

def insert_all
puts "start insert #{events.count} records into DB using insert_all ..."
events.each_slice(3000) do |es|
puts 'bulk insert 3000 records'
events.each_slice(50000) do |es|
puts 'bulk insert 50000 records'
GithubEvent.insert_all(es)
end
end
Expand Down

0 comments on commit f4ae5be

Please sign in to comment.