Optimizing Tables

Optimizing Tables

am 01.04.2007 21:35:51 von Anna V

------=_Part_268211_27437964.1175456151382
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello group,

I just have a quick question for you all. Here is it... Is it advisable to
run optimize table after each deletion of a record?

Thanks in advance,

Anna Vester

------=_Part_268211_27437964.1175456151382--

RE: Optimizing Tables

am 01.04.2007 21:44:25 von Bastien Koert

I would say no, due to the overhead. What I would recommned is setting that
up as a cron task and running it on a scheduled basis, usually when the
server is liightly loaded. Monitor the server and pick an optimal time. This
is the same for all server mainenance type situations like index monitoring
etc.

hth

Bastien


>From: "Anna V"
>To: php-db@lists.php.net
>Subject: [PHP-DB] Optimizing Tables
>Date: Sun, 1 Apr 2007 14:35:51 -0500
>
>Hello group,
>
>I just have a quick question for you all. Here is it... Is it advisable to
>run optimize table after each deletion of a record?
>
>Thanks in advance,
>
>Anna Vester

____________________________________________________________ _____
http://local.live.com/?mkt=en-ca/?v=2&cid=A6D6BDB4586E357F!4 20

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Optimizing Tables

am 01.04.2007 23:59:29 von Anna V

------=_Part_270039_31052995.1175464769805
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On 4/1/07, Bastien Koert wrote:
>
> I would say no, due to the overhead. What I would recommned is setting
> that
> up as a cron task and running it on a scheduled basis, usually when the
> server is liightly loaded. Monitor the server and pick an optimal time.
> This
> is the same for all server mainenance type situations like index
> monitoring
> etc.


That sounds reasonable. Thanks alot for your quick response.

------=_Part_270039_31052995.1175464769805--

RE: Optimizing Tables

am 02.04.2007 00:37:47 von ljbuesch

From the MySQL manual:

---
OPTIMIZE TABLE should be used if you have deleted a large part of a
table or if you have made many changes to a table with variable-length
rows (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns).
Deleted rows are maintained in a linked list and subsequent INSERT
operations reuse old row positions. You can use OPTIMIZE TABLE to
reclaim the unused space and to defragment the data file.
---

So, no, do not optimize table after each row deletion.

-----Original Message-----
From: Anna V [mailto:aserev@gmail.com]=20
Sent: Sunday, April 01, 2007 3:36 PM
To: php-db@lists.php.net
Subject: Optimizing Tables

Hello group,

I just have a quick question for you all. Here is it... Is it advisable
to
run optimize table after each deletion of a record?

Thanks in advance,

Anna Vester

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php