Archive

Archive for the ‘MySQL’ Category

Difference between MyISAM and InnoDB

April 12th, 2010

Difference between MyISAM and InnoDB

1. Transactions: InnoDB support transactions means You can commit and rollback with InnoDB but with MyISAM once you issue a command it’s done. But MYISAM does not support any database transactions means if the transactions related to large amount of data transfer it will not provide because memory is less.

2. Locking: INNODB provide the row level locking means if you are performing an insert into InnoDB table only that row will be locked not the entire table. While MYISAM provide the table level locking means if the data in one row has been modified, the entire table will lock for the next process.

3. Foreign keys – InnoDB support FK constraint but MYISAM tables do not support.

4. Data Types: MYISAM provide a full variety of datatypes, but INNODB will not.

5. Full Text Search: InnoDB does not support Full Text search but MyIsam provide full text search.

6. Memory Space: MYISAM occupies less memory sapce for tables rather than InnoDB tables.

Author: gaurav Categories: MySQL Tags:

MYSQL Query to export data order by given values in comma separated string:

June 7th, 2009

MYSQL Query to export data order by given values in comma separated string.  If you want to get the record in an specific order you can do it like this:

SELECT * FROM {TABLE_NAME} WHERE {FIELD_NAME} IN ( 23, 234, 543, 23 ) ORDER BY FIELD({FIELD_NAME}, 23, 234, 543, 23 )

Example:  SELECT * FROM `product_master` WHERE paSKU IN (’1a6′,’1a1′,’1a8′,’1a3′,’1a4′) ORDER BY FIELD (paSKU,’1a6′,’1a1′,’1a8′,’1a3′,’1a4′)

Author: gaurav Categories: MySQL Tags:
Site is Under Construction