![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Hello, I have an INSERT query that uses the ON DUPLICATE KEY UPDATE clause. The problem is that while inserts are done instantly, updates take up to 5-10 minutes before taking effect! Version: MySQL 5.0.37-LOG (Hosted server, so update not possible) Table: InnoDB, currently sized at 138 rows/ 32kb. Query Sample: INSERT INTO armory_ranking (character_hash,character_name,character_gamelevel ,character_region,character_realm,character_race,c haracter_class,character_faction,character_guild,c haracter_build,character_level,character_average) values ('Bollebob-EU- Magtheridon','Bollebob','70','EU','Magtheridon','U ndead','Rogue','Horde','Nihilum','','2292','134.82 ') ON DUPLICATE KEY UPDATE character_level = '2292', character_average = '134.82',character_guild = 'Nihilum',character_class = 'Rogue' It's all very strange to me, I've heard people saying that this is caused by write locks, but is there any way to speed these up? Regards. Brian | |||
|
| | #2 | ||
| On 2 Jul, 10:39, Thuman <bri...@thumann.dk> wrote: > Hello, > > I have an INSERT query that uses the ON DUPLICATE KEY UPDATE clause. > The problem is that while inserts are done instantly, updates take up > to 5-10 minutes before taking effect! > > Version: MySQL 5.0.37-LOG (Hosted server, so update not possible) > Table: InnoDB, currently sized at 138 rows/ 32kb. > > Query Sample: > INSERT INTO armory_ranking > (character_hash,character_name,character_gamelevel ,character_region,charact*er_realm,character_race, character_class,character_faction,character_guild, c*haracter_build,character_level,character_average ) > values ('Bollebob-EU- > Magtheridon','Bollebob','70','EU','Magtheridon','U ndead','Rogue','Horde','N*ihilum','','2292','134.8 2') > ON DUPLICATE KEY UPDATE character_level = '2292', character_average = > '134.82',character_guild = 'Nihilum',character_class = 'Rogue' > > It's all very strange to me, I've heard people saying that this is > caused by write locks, but is there any way to speed these up? > > Regards. > Brian I have to say that I've never come across this problem, but here's a hint to make the construction of the query a bit easier. Use the VALUES() function to save having to code the literals twice thus: INSERT INTO armory_ranking (character_hash,character_name,character_gamelevel ,character_region,charact* er_realm,character_race,character_class,character_ faction,character_guild,c* haracter_build,character_level,character_average) values ('Bollebob-EU- Magtheridon','Bollebob','70','EU','Magtheridon','U ndead','Rogue','Horde','N* ihilum','','2292','134.82') ON DUPLICATE KEY UPDATE character_level = VALUES(character_level), character_average = VALUES(character_average), character_guild = VALUES(character_guild), character_class = VALUES(character_class) | |||
|
| Featured Websites | ||||
|
![]() |
| Tags: duplicate, key, slow, update |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MySql UPDATE problem with duplicate rows | Jon Maz | Database | 7 | 07-01-2007 8:34 PM |
| PHP update | David Quinton | PHP | 0 | 07-01-2007 2:58 PM |
| Live Slow after May 360 Update | TheMachineRNC | Console Subjects | 2 | 06-26-2007 2:26 AM |
| Update replication dbs, force update? | George A. | Database | 0 | 06-25-2007 11:09 PM |
| Update | ulexander@gmail.com | Google questions | 0 | 05-28-2007 12:45 AM |
| Featured Websites | ||||
|