Difference between InnoDB and MyISAM? [duplicate]
Asked Answered
C

6

2

Possible Duplicate:
MyISAM versus InnoDB

Ok I read this information of Wikipedia and InnoDB seems better. Here is my question would it be OK to use InnoDB instead of MyISAM for selecting user data from the database? Or would it be better to stay with MyISAM for this.

And if I would to change to Inno would PDO still work with it and some old style query's?

$q = ("SELECT * ... );
$r = mysql_query($q);
Carmencita answered 16/5, 2011 at 20:11 Comment(0)
E
13
  • InnoDB uses row locking, MyISAM uses table locking, therefore...
  • InnoDB is slower when it comes to SELECT
  • InnoDB enforces referential integrity (which is as very good thing)
  • InnoDB allows transactions
Elvinelvina answered 16/5, 2011 at 20:46 Comment(1)
A SELECT statement doesn't cause a row/ table lock, does it?Lightner
O
3

Generally I go with InnoDB if my table will have more updates/inserts/delete statements then select statements or I want relational database with foreign keys, if not I stick with MyISAM. If you go with InnoDB you will give up select statement performance and the ability to do full text search indexes.

The MyISAM storage engine.

The InnoDB storage engine.

Obannon answered 16/5, 2011 at 20:28 Comment(0)
V
1

My be worthwhile to consider whether you'll be using mostly SELECT queries or INSERT / UPDATE, since InnoDB supports row-level locking (better for insert / update), but MyISAM uses table-level locking (faster if you'll use just select). See this from ref manual for more info.

Vivanvivarium answered 16/5, 2011 at 20:40 Comment(0)
H
0

InnoDB vs. MyISAM won't have any difference with how you code your select statements. Where it will help is allow for foreign keys, which will help you keep referential integrity in your database, and if properly setup, help ensure not creating orphan records.

See http://en.wikipedia.org/wiki/Foreign_key for more information.

Hurried answered 16/5, 2011 at 20:19 Comment(0)
C
0

The biggest advantage of innodb over myisam is that innodb supports transactions/rollbacks. myisam will provide better performance overall, as it does not incur the same overhead. For a simple user table you might be best to stick with myisam.

Cracking answered 16/5, 2011 at 20:22 Comment(0)
S
0

It would be completely OK to use InnoDB instead of MyISAM for selecting user data,. PDO will work with it too and so will mysql_query and mysqli_query,. they have nothing to do with the table type.

But keep in mind that there are many different configurations that you need to understand before you start using it,. if you are a casual developer i suggest staying with MyISAM

Shockproof answered 3/6, 2011 at 12:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.