RE: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Steven Staples
-Original Message- From: Andrés Tello [mailto:mr.crip...@gmail.com] Sent: May 12, 2012 10:08 AM To: mysql Subject: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this While doning a batch process... show full processlist show: | 544

Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Ananda Kumar
is accountid a number or varchar column On Sat, May 12, 2012 at 7:38 PM, Andrés Tello mr.crip...@gmail.com wrote: While doning a batch process... show full processlist show: | 544 | prod | 90.0.0.51:51262 | tmz2012 | Query |6 | end | update `account` set

Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Andrés Tello
Yes, I'm using indexes, accountid is the primary key, and is numeric and autoincrement. The process doing the deadlock is no longer done... The structure of the inserted database has changed. Originaly it was a single table with 219millions rows, now I partitioned the hable in... 60 tables, 1

Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Ananda Kumar
If numeric, then why are u using quotes. With quotes, mysql will ignore the index and do a full table scan On Mon, May 14, 2012 at 7:31 PM, Andrés Tello mr.crip...@gmail.com wrote: Yes, I'm using indexes, accountid is the primary key, and is numeric and autoincrement. The process doing the

Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Johan De Meersman
- Original Message - From: Ananda Kumar anan...@gmail.com If numeric, then why are u using quotes. With quotes, mysql will ignore the index and do a full table scan Will it? Common sense dictates that it would convert to the column's native type before comparing; and a quick explain

Re: Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-14 Thread Ananda Kumar
I used to have these issues in mysql version 5.0.41. On Mon, May 14, 2012 at 8:13 PM, Johan De Meersman vegiv...@tuxera.bewrote: - Original Message - From: Ananda Kumar anan...@gmail.com If numeric, then why are u using quotes. With quotes, mysql will ignore the index and do a

Mysql is toying me... why sometimes an insert or update can be slow!? I getting bald cuz this

2012-05-12 Thread Andrés Tello
While doning a batch process... show full processlist show: | 544 | prod | 90.0.0.51:51262 | tmz2012 | Query |6 | end | update `account` set `balance`= 0.00 + '-4000' where accountid='2583092' No other process, lo locking no nothing... so you take this same

Re: who knows the difference between INSERT and UPDATE

2009-12-06 Thread mos
At 12:13 AM 12/6/2009, Oscar wrote: hi all, Someone told me that UPDATE equals DELETE old row + INSERT new row. Anybody clarify it? Are you talking about InnoDb or MyISAM tables. I'm only familiar with MyISAM tables. Perhaps he was referring to an Update that added more text to a variable

who knows the difference between INSERT and UPDATE

2009-12-05 Thread Oscar
hi all, Someone told me that UPDATE equals DELETE old row + INSERT new row. Anybody clarify it? thanks, -Oscar -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: £ (Great Britain Pound) breaks MySQL insert and update - disastrous overwrit e

2006-10-20 Thread Warren Young
Paul Warner wrote: When a user enters text with a £ sign (Great Britain Pound) in the browser and clicks enter, any insert or update statement apparently gets truncated in mysql. It's possible that somewhere along the line, the character is getting translated to a multibyte Unicode format

Re: £ (Great Britain Pound) breaks MySQL insert and update - disastrous overwrit e

2006-10-20 Thread Philip Mather
Warren Young wrote: Paul Warner wrote: When a user enters text with a £ sign (Great Britain Pound) in the browser and clicks enter, any insert or update statement apparently gets truncated in mysql. It's possible that somewhere along the line, the character is getting translated

Re: £ (Great Britain Pound) breaks MySQL insert and update - disastrous overwrit e

2006-10-20 Thread Philip Mather
Warren Young wrote: Paul Warner wrote: When a user enters text with a £ sign (Great Britain Pound) in the browser and clicks enter, any insert or update statement apparently gets truncated in mysql. It's possible that somewhere along the line, the character is getting translated

Re: £ (Great Britain Pound) breaks MySQL insert and update - disastrous overwrit e - FIXED

2006-10-20 Thread Warren Young
Paul Warner wrote: Now we are in UTF-8, it is saving everything I can throw at it without creating garbage characters. Whew. Yep. Even though it wasn't the solution to your immediate problem, switching to UTF-8 will prevent a whole class of future ones. -- MySQL General Mailing List For

Re: £ (Great Britain Pound) breaks MySQL insert and update - disastrous overwrit e

2006-10-19 Thread Gerald L. Clark
for each request). I added the following code that processes all the fields before submitting to the database for update or insert. Charset utfCharset = Charset.forName(UTF-8); CharsetDecoder decoder = utfCharset.newDecoder(); CharsetEncoder encoder = utfCharset.newEncoder(); try { ByteBuffer

Insert and Update together

2006-02-11 Thread Andre Matos
Hi List, I would like to know if it is possible to combine Insert and Update in one SQL instruction. This is what I want to do: I have two tables: one where I will perform and Update replacing m0 by scr. If MySQL find a m0, it will need to perform an insert into a log table including

Re: Insert and Update together

2006-02-11 Thread George Law
this on was running 4.0.x so I couldn't use it. http://dev.mysql.com/doc/refman/5.0/en/insert.html - Original Message - From: Andre Matos [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Saturday, February 11, 2006 10:54 AM Subject: Insert and Update together Hi List, I would like

Fw: Insert and Update together

2006-02-11 Thread Rhino
Oops, I meant to send this to the list so that everyone could benefit, not just to Andre. -- Rhino - Original Message - From: Rhino [EMAIL PROTECTED] To: Andre Matos [EMAIL PROTECTED] Sent: Saturday, February 11, 2006 12:11 PM Subject: Re: Insert and Update together

Re: Insert and Update together

2006-02-11 Thread Andre Matos
was testing this on was running 4.0.x so I couldn't use it. http://dev.mysql.com/doc/refman/5.0/en/insert.html - Original Message - From: Andre Matos [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Saturday, February 11, 2006 10:54 AM Subject: Insert and Update together

RE: Insert and Update together

2006-02-11 Thread Logan, David (SST - Adelaide)
--- -Original Message- From: Andre Matos [mailto:[EMAIL PROTECTED] Sent: Sunday, 12 February 2006 2:23 PM To: George Law; mysql@lists.mysql.com Subject: Re: Insert and Update together No George. I took a look there before sent this email

RE: Triggers that handle multiple events (insert and update)

2005-11-10 Thread Burke, Dan
@lists.mysql.com Subject: RE: Triggers that handle multiple events (insert and update) onsdagen den 9 november 2005 18:07 skrev Burke, Dan: For example, one field has to be = 0, so I put this validation Why don't you just declare that field as unsigned? Björn Persson -- MySQL General Mailing List

Triggers that handle multiple events (insert and update)

2005-11-09 Thread Burke, Dan
Hello, Can triggers in 5.0 handle multiple events? I have some range checking I'd like to enforce at the database level when inserting or updating a record, and I'm finding myself duplicating trigger code to make an INSERT and an UPDATE trigger, which makes it harder to maintain in the long run

Re: Triggers that handle multiple events (insert and update)

2005-11-09 Thread SGreen
Burke, Dan [EMAIL PROTECTED] wrote on 11/09/2005 09:05:50 AM: Hello, Can triggers in 5.0 handle multiple events? I have some range checking I'd like to enforce at the database level when inserting or updating a record, and I'm finding myself duplicating trigger code to make an INSERT

RE: Triggers that handle multiple events (insert and update)

2005-11-09 Thread Burke, Dan
I see what you're saying. That won't really help, because I'll still be duplicating changes in the update and insert triggers every time I add a new field. The hope was that I would only need to do it once. Your method sounds like it could become costly from an execution time perspective

RE: Triggers that handle multiple events (insert and update)

2005-11-09 Thread Björn Persson
onsdagen den 9 november 2005 18:07 skrev Burke, Dan: For example, one field has to be = 0, so I put this validation Why don't you just declare that field as unsigned? Björn Persson -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Conditional insert or update.

2005-07-20 Thread Paul Halliday
Hi, I have a table that looks something like this: ip | mac_current | mac_change now if I have an entry that looks like this 10.0.0.1 | 11:11:11:11:11:11:11 | NULL If the next time the script runs and the mac has changed, how can I catch this and put the new MAC into mac_change? Ultimately,

Re: Conditional insert or update.

2005-07-20 Thread Gleb Paharenko
Hello. Please, provide more information on your's application logic. To catch events which occurs for the table use triggers. See: http://dev.mysql.com/doc/mysql/en/triggers.html Unfortunately they're available only in MySQL 5.0.x, which is still beta. Paul Halliday [EMAIL

Re: Conditional insert or update.

2005-07-20 Thread Paul Halliday
Ok, The entire table looks like this: ip | hostname | mac_current | mac_change | port_current | port_change The IP addresses are harvested via netflow (a different table) and or arpwatch (an event). This new table is to augment the current information that is within the netflow tables but

RE: Insert if Update failed without Select

2005-01-17 Thread Logan, David (SST - Adelaide)
@lists.mysql.com Subject: Re: Insert if Update failed without Select [EMAIL PROTECTED] wrote: Please also note hat UPDATE returns the number of records updated. If your UPDATE returns 0, you know that the record does not exist, and you might want to INSERT instead. There is one situation

Re: Insert if Update failed without Select

2005-01-16 Thread beacker
Please also note hat UPDATE returns the number of records updated. If your UPDATE returns 0, you know that the record does not exist, and you might want to INSERT instead. There is one situation where the number of records updated will return 0, yet the row exists. If you update the record

Re: Insert if Update failed without Select

2005-01-16 Thread sam wun
[EMAIL PROTECTED] wrote: Please also note hat UPDATE returns the number of records updated. If your UPDATE returns 0, you know that the record does not exist, and you might want to INSERT instead. There is one situation where the number of records updated will return 0, yet the row exists.

Insert if Update failed without Select

2005-01-15 Thread sam wun
Hi, Without using Select statement, how can I execute Insert SQL statement if Update action is failed? I may be asking for too much. If Select statemnet have to be used to determine the existence of a recordset, what is an efficient way to execute Insert if Update is failed? I m using MySQL 5.0

Re: Insert if Update failed without Select

2005-01-15 Thread Mattias J
At 2005-01-15 14:48, you wrote: Without using Select statement, how can I execute Insert SQL statement if Update action is failed? I may be asking for too much. If Select statemnet have to be used to determine the existence of a recordset, what is an efficient way to execute Insert if Update

Re: Insert if Update failed without Select

2005-01-15 Thread Mattias J
SQL statement if Update action is failed? I may be asking for too much. If Select statemnet have to be used to determine the existence of a recordset, what is an efficient way to execute Insert if Update is failed? I m using MySQL 5.0 Look at http://dev.mysql.com/doc/mysql/en/REPLACE.html -- MySQL

Re: Question about INSERT vs UPDATE

2003-06-15 Thread Becoming Digital
INSERT vs UPDATE Hello, I am new to the list, so pardon me if I am on the wrong one posting my question. If so, please direct me to the right place. My question is in regards to the efficiency of INSERT statements. I have gone over some of the optimizations, and on a machine running

Re: Question about INSERT vs UPDATE

2003-06-15 Thread Shane Bryldt
As my post suggested, I have already addressed the tweaks this this section of the manual addresses, and was hoping there might be some insight on my original question, the process of INSERT vs UPDATE. That chapter was helpful initially, but I have already addressed most of what that chapter

Re: Question about INSERT vs UPDATE

2003-06-15 Thread Becoming Digital
As my post suggested, I have already addressed the tweaks this this section of the manual addresses, and was hoping there might be some insight on my original question, the process of INSERT vs UPDATE. Gotcha. I wasn't sure if you'd checked the manual or just run a huge number of EXPLAINs

Re: Question about INSERT vs UPDATE

2003-06-15 Thread Shane Bryldt
INSERT vs UPDATE As my post suggested, I have already addressed the tweaks this this section of the manual addresses, and was hoping there might be some insight on my original question, the process of INSERT vs UPDATE. Gotcha. I wasn't sure if you'd checked the manual or just run a huge number

Question about INSERT vs UPDATE

2003-06-14 Thread Shane Bryldt
Hello, I am new to the list, so pardon me if I am on the wrong one posting my question. If so, please direct me to the right place. My question is in regards to the efficiency of INSERT statements. I have gone over some of the optimizations, and on a machine running the client and

Re: mysql: multiple SELECTs with INSERT or UPDATE??

2002-10-06 Thread John Ragan
corereader contains safeguards to prevent updates, but its design helps quick development of queries such as yours. you can do a multiple join with multiple selects just by pointing and clicking to try out various ideas. it's free at http://corereader.com/ it installs at the novice skill

mysql: multiple SELECTs with INSERT or UPDATE??

2002-10-05 Thread Mirza
Hi, i am inserting data in a mysql table like this: INSERT INTO mytable1 (bu_main_id) SELECT main_id FROM mytable2 WHERE username=\$username\ that's ok. but now i would like to insert 2 values (bu_main_id and status), and i would like to know, is it possible to

Re: mysql: multiple SELECTs with INSERT or UPDATE??

2002-10-05 Thread Paul DuBois
At 15:54 +0200 10/5/02, Mirza wrote: Hi, i am inserting data in a mysql table like this: INSERT INTO mytable1 (bu_main_id) SELECT main_id FROM mytable2 WHERE username=\$username\ that's ok. but now i would like to insert 2 values (bu_main_id and status),

INSERT OR UPDATE

2001-12-29 Thread Joel Wickard
Hello all, I need to write a query that will insert data into a table if there is no row matching a pre-specified ID, but will update a row if it matches a pre-specified ID. Any pointers would be great. - Before posting,

RE: INSERT OR UPDATE

2001-12-29 Thread Roger Baklund
* Joel Wickard I need to write a query that will insert data into a table if there is no row matching a pre-specified ID, but will update a row if it matches a pre-specified ID. Any pointers would be great. The REPLACE statement: URL: http://www.mysql.com/doc/R/E/REPLACE.html -- Roger