IT Community - Software Programming, Web Development and Technical Support

Faster Database Oracle vs Mysql

This is a discussion on Faster Database Oracle vs Mysql within the Database Support forums, part of the Web Development category; Hi, when executing the same update statement many times , mysql says N rows updated only on first time next it ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-20-2007, 05:30 AM
vivekanandan vivekanandan is offline
D-Web Trainee
 
Join Date: Jul 2007
Posts: 41
vivekanandan is on a distinguished road
Lightbulb Faster Database Oracle vs Mysql

Hi,
when executing the same update statement many times , mysql says N rows updated only on first time next it says 0 Rows Updated, but other database like oracle it shows N Rows updated for Each executation time .
is it MYSQL Optimization which makes mysql faster or bug ?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 09-04-2007, 03:10 AM
priyan priyan is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 133
priyan is on a distinguished road
Default Re: Faster Database Oracle vs Mysql

Hi,

While updating, If you set a column to the value it currently available in the table then MySQL notices this and does not update it. Generally MySQL does't do dummy update.

Go thru the below given example,

Quote:
mysql> create table updt_test
-> (
-> id integer,
-> name varchar(30)
-> );
Query OK, 0 rows affected (0.03 sec)

mysql> insert into updt_test values (1, 'philip');
Query OK, 1 row affected (0.00 sec)

mysql> insert into updt_test values (2, 'john');
Query OK, 1 row affected (0.00 sec)

mysql> insert into updt_test values (3, 'smith');
Query OK, 1 row affected (0.00 sec)

mysql> select * from updt_test;
+------+--------+
| id | name |
+------+--------+
| 1 | philip |
| 2 | john |
| 3 | smith |
+------+--------+
3 rows in set (0.00 sec)

mysql> UPDATE updt_test SET name = 'john' WHERE id = 2;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
-- HERE THE CONDITION MATCHES BUT THE VALUE AVAILABLE IN THE TABLE IS THE SAME AS IN UPDATE STATEMENTS, here no row will be affected.



mysql> UPDATE updt_test SET name = 'john patrick' WHERE id = 2;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
-- HERE THE CONDITION MATCHES BUT THE VALUE AVAILABLE IN THE TABLE IS NOT THE SAME AS IN UPDATE STATEMENTS, so update works here.


mysql> select * from updt_test;
+------+--------------+
| id | name |
+------+--------------+
| 1 | philip |
| 2 | john patrick |
| 3 | smith |
+------+--------------+
3 rows in set (0.00 sec)

mysql> UPDATE updt_test SET name = 'john patrick' WHERE id = 2;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0

mysql>
__________________
Keep smiling...

Last edited by priyan : 09-04-2007 at 03:39 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get sequence number from oracle database using biztalk oracle db adapter arjkhanna Server Management 3 06-11-2009 02:30 AM
How can I convert a Access database to a MySQL database? itbarota PHP Programming 2 09-13-2007 09:04 AM
Oracle Database Objects Murali Database Support 7 09-05-2007 05:09 AM
Advantages to using Oracle’s CREATE DATABASE vadivelanvaidyanathan Database Support 1 07-17-2007 01:59 AM
Oracle Database Lite 10g Karpagarajan Database Support 3 03-29-2007 03:26 PM


All times are GMT -7. The time now is 04:16 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0