BTW,If a storage engine is specified that is not available, MySQL uses the default engine instead.
For storage engines that do not support foreign keys (such as MyISAM), MySQL Server parses and ignores foreign key specifications.
BTW,If a storage engine is specified that is not available, MySQL uses the default engine instead.
For storage engines that do not support foreign keys (such as MyISAM), MySQL Server parses and ignores foreign key specifications.
That is exactly right... There is a reason Innodb (or other similar SE) came into existence and currently used as the default engine because of the limitation & performance on MyIsam. I know now might not be the time for phpbb to specifically use Innodb, but this is something that needs to be adapted in the future. Probably by the time 3.2 comes out, it should not be an issue for phpbb to use Innodb for the latest version since most users should be having the later version of Mysql (or would need to upgrade to a later version) to benefit from additional benefits it has to offer.brunoais wrote:In MySQL's case, if the selected default DB engine is InnoDB, then phpBB could have optimized DB speeds for the multiple JOIN's it has.
Currently, phpBB doesn't use that so JOIN's are way slower than how they could be.
We can check on foreign key support on case-by-case basis for other DBMS.
What would break by using foreign keys?DavidIQ wrote:You'll need to provide some numbers in order to make a decision like that as adding foreign keys will break many things. Even if we decided on doing that I don't think it would/should be done in 3.2.
Can you even do that if the column is set as NOT NULL, which most of them are?brunoais wrote:We just use the "ON DELETE SET NULL ON UPDATE CASCADE" and that shouldn't bother.
I've seen this myth being perpetuated online for as long as I can remember. In my experience, people can rarely trace back how that idea came to them. My hypothesis is that some people found better performance after adding foreign keys in databases that had no index. Foreign keys usually create or require a matching index, therefore adding foreign keys to a table that had no secondary index would sometimes have the same benefits than adding the right indexes, or close to.Marshalrusty wrote:Which brings me to my main point: where did you get the idea that adding foreign keys improves performance?