PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > Slow MySQL Table Inserts
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Slow MySQL Table Inserts

Réponse
 
LinkBack Outils de la discussion
Vieux 07/09/2007, 18h32   #1 (permalink)
Chris Portka
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Slow MySQL Table Inserts

I'm trying to create a table in MySQL with a few simple requirements,
but my table loads data very slowly. I need two columns, one of them a
10 digit string and another a very large integer. These pairs must be
unique. There must be an index on the 10 digit string for fast lookups.
Here's how I'm creating the table:

create table min (
mobile char(10),
bucketid bigint,
foreign key (bucketid) references idbucket2(id),
unique index uniqueminindex using btree (mobile, bucketid)
);

What could I be doing wrong? I require that the table have on the order
of a million entries. All inserts into the table are fairly slow, and
get slower the more things are inserted - with it eventually becoming
unbearably slow to add data. Thanks for any ,
Chris Portka
  Réponse avec citation
Vieux 07/09/2007, 18h51   #2 (permalink)
Baron Schwartz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Slow MySQL Table Inserts

Chris Portka wrote:
> I'm trying to create a table in MySQL with a few simple requirements,
> but my table loads data very slowly. I need two columns, one of them a
> 10 digit string and another a very large integer. These pairs must be
> unique. There must be an index on the 10 digit string for fast lookups.
> Here's how I'm creating the table:
>
> create table min (
> mobile char(10),
> bucketid bigint,
> foreign key (bucketid) references idbucket2(id),
> unique index uniqueminindex using btree (mobile, bucketid)
> );
>
> What could I be doing wrong? I require that the table have on the
> order of a million entries. All inserts into the table are fairly slow,
> and get slower the more things are inserted - with it eventually
> becoming unbearably slow to add data. Thanks for any ,


What is "fairly slow" and "unbearably slow" in terms of rows per second
(or seconds per row)?

What storage engine are you using?

Do you need a foreign key? (this is related to the storage engine question)

Do the columns need to be NULL-able?

What is the output of SHOW CREATE TABLE, and is it what you expect?

In what order are you inserting the data?

Baron
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h22.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08485 seconds with 10 queries