New To Yii And Oo - Myisam, Leave Relations Empty?
Posted 26 October 2012 - 09:47 PM
I'm new to Yii and also learning OO atm, I have a project which is supposed to be a single user system to track traffic from paid advertisements.
Now I did my research on what MYSQL engine to use for my reporting database, and came to the conclusion that it must be MYISAM because of the much better read performance when using fixed rows with char columns.
The reporting part of the system will have like 95% reads/5% insert/update/delete, and potentially have tens or even hundreds of millions of rows with tracking data after a while. And to quickly build reports of this data I think I have to use MYISAM over INNODB and a single table approach for the tracking data to get the most read performance out of the system...
Ok that was now just to explain what I build and why I use MYISAM
The real question I have is if I can or should leave the relations methods in the models that gii generated for me, completely empty...? Or will that have any negative effects that I don't know about yet, because I am still learning everything.
BTW: Thanks a lot for making yii, it seems to be an awesome framework and I'm sure I will use it for all of my projects in the future!
Posted 27 October 2012 - 05:45 AM
Relations array is automaticly filled (by gii) when you have constraints defined between tables (which is only possible using InnoDB engine)
If you opt for MyISAM these relations are not beeing constructed by gii. But there is no resaon why you can not define relations array by hand. although note that there is a vast options of other kinds of relations that can be defined (such as stat queries or some other specific query). And yes, it is perfectly fine to leave relations array empty if you do not want to use it (but you should, as it is a nice way to define common used queries)
Posted 27 October 2012 - 11:09 AM
In v1.0.x, you could define relations via column comments. I don't know if this still works in v1.1, but it might be worth the try.
Posted 27 October 2012 - 10:27 PM
Danke! good tip, could be worth testing that