Home « Server software «
Documentation: control/setup.php
control/setup.php - Adjust the database schema and optimize data
This script will consider each table that has to be present in the database. If the table does not exist, it will be created. Else columns are checked one by one, and altered if necessary. All indexes are rebuilt.The structure of each table in described into related database abstractions. Look for the
setup()
function in following scripts:
- actions/actions.php
- agents/browsers.php
- agents/profiles.php
- agents/referrals.php
- articles/articles.php
- categories/categories.php
- comments/comments.php
- dates/dates.php
- decisions/decisions.php
- files/files.php
- images/images.php
- links/links.php
- locations/locations.php
- sections/sections.php
- servers/servers.php
- shared/cache.php
- shared/values.php
- tables/tables.php
- users/users.php
- versions/versions.php
Also, additional database abstractions can be taken into account through the following hook:
- id: 'control/setup.php'
- type: 'include'
The integrated search engine is based on full-text indexing capabilities of MySQL. Currently this is only available for the
MyISAM
table type.
Therefore we enforce this type into every MySQL CREATE
statement.This script will also analyze and optimize tables, and can be safely launched periodically to enhance response times, to reduce the size of data files and to rebuild indexes.
The MySQL ANALYZE statement analyzes and stores the key distribution for a table. MySQL uses the stored key distribution to decide the order in which tables should be joined when you perform a join on something other than a constant.
The MySQL OPTIMIZE command works as follows:
- If the table has deleted or split rows, repair the table.
- If the index pages are not sorted, sort them.
- If the statistics are not up to date (and the repair couldn't be done by sorting the index), update them.
Access to this script is restricted to associates, except if no user profile exists in the database. In this case, which is likely to happen on first installation, the current surfer is flagged as being an associate.
Also, this script executes normally even in demonstration mode.
This script is a reference file of this system.
Voir aussi:
- control/scan.php
- MySQL Manual | 12.6 Full-Text Search Functions
- ANALYZE TABLE Syntax
- OPTIMIZE TABLE Syntax
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
Testeurs:
- James Wharris
- Lilou
- Anatoly
Reste à faire:
- alter tables to utf8
send_body() - Dynamically generate the page
function send_body()
Voir aussi: