Hello,
I'm using:
- PHP 5.4/5.5
- Micrsoft IIS 8 server
- Windows 8 64-bit
I am working with Moodle 1.9.7 and 2.5 databases in PostgreSQL 9.2, and I have noticed that there are no foreign keys between the tables. I can see the indexes having been created, but no foreign keys.
I discovered that in trying to optimize dynamically-generated SQL queries I was making in a Web application that took tremendous amounts of time.
I searched for that on Google and the Moodle forums, and I saw that by default Moodle does not create the foreign keys during installation. However, I read that we can enable foreign keys using this file ("C:\Moodle 2.5\moodle\lib\ddl\sql_generator.php") and/or also the install.xml file in moodle\lib\db.
Would it be possible for you to explain more what it's all about? Do we have to manually create foreign key references on installing Moodle (or using a script or option), or does Moodle include some other mechanism that sort of replaces the foreign keys? I noticed there are indexes, however. Will the absence of foreign keys cause a decrease in performance in the execution of my SQL queries in my PHP Web application?
Any insight will be appreciated.
Thanks, Jeremie