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 wrote: > - Original Message - > > From: "Ananda Kumar" > > > > If numeric, then why are u using quotes. With quotes, mysql will > > ignore the index and do a full table scan > > Will

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" > > 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 seems to co

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 wrote: > > > Yes, I'm using indexes, accountid is the primary key, and is numeric and > autoincrement. The process doing the deadlock is no lo

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 for

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 wrote: > 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 + >

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... > &

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 query.

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 speci

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 PROTEC

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: 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 l

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

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 t

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: http://www.mysql.com/doc/R/E/REPLACE.html > -- Roger

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, pleas