Jump to content
php.lv forumi

par optimez datu bāzei


sandrulis

Recommended Posts

Optimizēt datu bāzi pēc pieprasījuma?vai arī kad lietotājs ielogojas?

Tas ir kaa? Tad kad lietotaajs ielagojas, kjeries pie DB optimizeesanas???

P.S. 20 K ierakstu Datu bazei nav daudz, ja normala struktura tad arii 1M nebuus nekas nopietns ...

Link to comment
Share on other sites

Pats MySQL saka, ka:

In most setups, you need not run OPTIMIZE TABLE at all. Even if you do a lot of updates to variable-length rows, it is not likely that you need to do this more than once a week or month and only on certain tables.

Un tur komentāros arīsaka šādu lietu:

For InnoDB, if you have your tables in one tablespace, this will make a complete copy of the table within the tablespace, making the tablespace larger by the total table size less the free space you started with. It will not reduce the tablespace size. ...

un arī MyISAM gadījumā:

Also at MyISAM tables, the optimize needs a whole datafile of free hd space to free the not-used space in the file.

This means, that you need at least (database + data of biggest table) storage at the database directory (my case).

 

This may be very unfortunate, if you have (some, but) one very big table in your database, which needs almost all the storage... ;(

 

http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html

http://www.mydigitallife.info/2007/09/21/c...th-crontabcron/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...