The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 16, 2019, 10:05:03 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: mysql insert  (Read 1852 times)
jammaster82
Lifer
*****
Offline Offline

Posts: 666


Thats craigs list for ya


View Profile
« on: February 13, 2008, 10:46:22 AM »

I have a huge SQL insert i need to
do to import a .csv file into mysql
server.

Whats the best way to get this
data into the mysql server, it is
790502 lines long.
Logged

The watched pot, never boils... But if you walk away from it , the soup burns.  What gives?
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: February 13, 2008, 10:56:28 AM »

With lots and lots of rows I'd explode them into individual calls and update them one by one. It'll take a while, but that's plenty stable.

TURN OFF INDEXES with the exception of something like an auto-incrementing primary key field... otherwise you're going to pay a huger and huger penalty for every row you insert.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!