Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Standup 1/11/2011: 10,000

Onsi Fakhouri
Tuesday, January 11, 2011

Ask for Help

“Does Active Record have batched insert? I need to dump 10,000 rows into the database in process and I don’t want it to take 45 seconds.”

The upshot: use a raw SQL INSERT statement.

Interesting Things

For a day as interesting as today (1/11/11 anyone?) there were surprisingly few interesting things of note.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

2 Comments

  1. pete says:

    Creating many records is exactly what the activerecord-import gem was made for.

    January 11, 2011 at 10:07 am

  2. Duncan Beevers says:

    When we do big inserts, we often use this handy utility module: https://gist.github.com/7681

    It provides a decent interface to MySQL’s INSERT ON DUPLICATE KEY UPDATE functionality which is really nice for avoiding the race conditions / rescue / retry you sometimes run into with plain old validates_uniqueness_of

    January 11, 2011 at 10:36 am

Add New Comment Cancel reply

Your email address will not be published.

Onsi Fakhouri

Onsi Fakhouri
San Francisco

Recent Posts

  • Cocktail: DRY up your backbone code with mixins
  • Coccyx: plug up those backbone leaks
  • [SF] Standup 4/26/2012: Hush Terminal, Hush
Subscribe to Onsi's Feed

Author Topics

backbone (2)
javascript (2)
agile (12)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >