DELETE DATA FROM TABLE

DELETE DATA FROM TABLE

am 19.11.2009 09:12:47 von Krishna Chandra Prajapati

--005045017f2cae797a0478b4ec08
Content-Type: text/plain; charset=ISO-8859-1

Hi Experts,

I have a crm table where 12 millions records inserted/day. We are running
report queries on this table and using partitioning features for faster
results. we have to maintain 45 days data means 540million records. As per
my calculation 540 records will use 1.8 TB of disk space. Total disk space
available is 2.3TB.

Deleting data doesn't free up the disk space. So, I was thinking of rotating
the table. But doesn't have enough disk space.

Any Idea, how this task can be performed.

Any idea or suggestion is highly appreciated.

Thanks & Regards,
Krishna Ch. Prajapati

--005045017f2cae797a0478b4ec08--

Re: DELETE DATA FROM TABLE

am 19.11.2009 09:52:35 von Jay Ess

Krishna Chandra Prajapati wrote:
> Hi Experts,
>
> I have a crm table where 12 millions records inserted/day. We are running
> report queries on this table and using partitioning features for faster
> results. we have to maintain 45 days data means 540million records. As per
> my calculation 540 records will use 1.8 TB of disk space. Total disk space
> available is 2.3TB.
>
> Deleting data doesn't free up the disk space. So, I was thinking of rotating
> the table. But doesn't have enough disk space.
>
> Any Idea, how this task can be performed.
>
> Any idea or suggestion is highly appreciated.
>
The space is freed inside the table space but is not seen on disk. Use
"show table status" to show a tables "data_free" variable.
If you prompt want to free the space so you can see it on the file
system you can use "optimize table" command. But the operation can be
slow and the table will be locked.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

RE: DELETE DATA FROM TABLE

am 19.11.2009 09:52:50 von Gavin Towey

Assuming you're using either myisam tables, or innodb with file-per-table o=
ption turned on, then dropping a whole partition at a time will allow you t=
o reclaim disk space.

If you're using innodb with a single tablespace currently, then unfortunate=
ly, you would have to export all your data, shutdown mysql, change you're m=
y.cnf & delete the tablespace & ib_log files, then restart and re-import al=
l your data. If you need to do this, you should probably seek a bit more i=
nformation about from this list or other sources.

Regards,
Gavin Towey

-----Original Message-----
From: Krishna Chandra Prajapati [mailto:prajapatikc@gmail.com]
Sent: Thursday, November 19, 2009 12:13 AM
To: MySQL
Subject: DELETE DATA FROM TABLE

Hi Experts,

I have a crm table where 12 millions records inserted/day. We are running
report queries on this table and using partitioning features for faster
results. we have to maintain 45 days data means 540million records. As per
my calculation 540 records will use 1.8 TB of disk space. Total disk space
available is 2.3TB.

Deleting data doesn't free up the disk space. So, I was thinking of rotatin=
g
the table. But doesn't have enough disk space.

Any Idea, how this task can be performed.

Any idea or suggestion is highly appreciated.

Thanks & Regards,
Krishna Ch. Prajapati

The information contained in this transmission may contain privileged and c=
onfidential information. It is intended only for the use of the person(s) n=
amed above. If you are not the intended recipient, you are hereby notified =
that any review, dissemination, distribution or duplication of this communi=
cation is strictly prohibited. If you are not the intended recipient, pleas=
e contact the sender by reply email and destroy all copies of the original =
message.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: DELETE DATA FROM TABLE

am 19.11.2009 10:15:20 von Krishna Chandra Prajapati

--000e0cd32f5467a0960478b5cce0
Content-Type: text/plain; charset=ISO-8859-1

Hi Gavin,

I am using innodb with file-per-table. I agree with you dropping a partition
will reclaim disk space.
alter table

drop partition

But, my concern is "alter table
drop partition name>" on very big table would might take a lot of time. (Although, I
haven't tested)

Thanks for the immediate response.

Thanks & Regard,
Krishna Ch. Prajapati

On Thu, Nov 19, 2009 at 2:22 PM, Gavin Towey wrote:

> Assuming you're using either myisam tables, or innodb with file-per-table
> option turned on, then dropping a whole partition at a time will allow you
> to reclaim disk space.
>
> If you're using innodb with a single tablespace currently, then
> unfortunately, you would have to export all your data, shutdown mysql,
> change you're my.cnf & delete the tablespace & ib_log files, then restart
> and re-import all your data. If you need to do this, you should probably
> seek a bit more information about from this list or other sources.
>
> Regards,
> Gavin Towey
>
> -----Original Message-----
> From: Krishna Chandra Prajapati [mailto:prajapatikc@gmail.com]
> Sent: Thursday, November 19, 2009 12:13 AM
> To: MySQL
> Subject: DELETE DATA FROM TABLE
>
> Hi Experts,
>
> I have a crm table where 12 millions records inserted/day. We are running
> report queries on this table and using partitioning features for faster
> results. we have to maintain 45 days data means 540million records. As per
> my calculation 540 records will use 1.8 TB of disk space. Total disk space
> available is 2.3TB.
>
> Deleting data doesn't free up the disk space. So, I was thinking of
> rotating
> the table. But doesn't have enough disk space.
>
> Any Idea, how this task can be performed.
>
> Any idea or suggestion is highly appreciated.
>
> Thanks & Regards,
> Krishna Ch. Prajapati
>
> The information contained in this transmission may contain privileged and
> confidential information. It is intended only for the use of the person(s)
> named above. If you are not the intended recipient, you are hereby notified
> that any review, dissemination, distribution or duplication of this
> communication is strictly prohibited. If you are not the intended recipient,
> please contact the sender by reply email and destroy all copies of the
> original message.
>

--000e0cd32f5467a0960478b5cce0--

RE: DELETE DATA FROM TABLE

am 19.11.2009 19:45:14 von Gavin Towey

--_000_30B3DF511CEC5C4DAE4D0D29050475341B1B9D12C0AAApmgiloca l_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi Krishna,

Drop partition should be very quick - much faster than doing a DELETE on th=
e same amount of data. Internally, it will be the same as doing a drop tab=
le for that partition.

Regards,
Gavin Towey

From: Krishna Chandra Prajapati [mailto:prajapatikc@gmail.com]
Sent: Thursday, November 19, 2009 1:15 AM
To: Gavin Towey
Cc: MySQL
Subject: Re: DELETE DATA FROM TABLE

Hi Gavin,

I am using innodb with file-per-table. I agree with you dropping a partitio=
n will reclaim disk space.
alter table

drop partition

But, my concern is "alter table
drop partition >" on very big table would might take a lot of time. (Although, I haven't t=
ested)

Thanks for the immediate response.

Thanks & Regard,
Krishna Ch. Prajapati
On Thu, Nov 19, 2009 at 2:22 PM, Gavin Towey ffn.com>> wrote:
Assuming you're using either myisam tables, or innodb with file-per-table o=
ption turned on, then dropping a whole partition at a time will allow you t=
o reclaim disk space.

If you're using innodb with a single tablespace currently, then unfortunate=
ly, you would have to export all your data, shutdown mysql, change you're m=
y.cnf & delete the tablespace & ib_log files, then restart and re-import al=
l your data. If you need to do this, you should probably seek a bit more i=
nformation about from this list or other sources.

Regards,
Gavin Towey

-----Original Message-----
From: Krishna Chandra Prajapati [mailto:prajapatikc@gmail.com atikc@gmail.com>]
Sent: Thursday, November 19, 2009 12:13 AM
To: MySQL
Subject: DELETE DATA FROM TABLE

Hi Experts,

I have a crm table where 12 millions records inserted/day. We are running
report queries on this table and using partitioning features for faster
results. we have to maintain 45 days data means 540million records. As per
my calculation 540 records will use 1.8 TB of disk space. Total disk space
available is 2.3TB.

Deleting data doesn't free up the disk space. So, I was thinking of rotatin=
g
the table. But doesn't have enough disk space.

Any Idea, how this task can be performed.

Any idea or suggestion is highly appreciated.

Thanks & Regards,
Krishna Ch. Prajapati
The information contained in this transmission may contain privileged and c=
onfidential information. It is intended only for the use of the person(s) n=
amed above. If you are not the intended recipient, you are hereby notified =
that any review, dissemination, distribution or duplication of this communi=
cation is strictly prohibited. If you are not the intended recipient, pleas=
e contact the sender by reply email and destroy all copies of the original =
message.


________________________________
The information contained in this transmission may contain privileged and c=
onfidential information. It is intended only for the use of the person(s) n=
amed above. If you are not the intended recipient, you are hereby notified =
that any review, dissemination, distribution or duplication of this communi=
cation is strictly prohibited. If you are not the intended recipient, pleas=
e contact the sender by reply email and destroy all copies of the original =
message.

--_000_30B3DF511CEC5C4DAE4D0D29050475341B1B9D12C0AAApmgiloca l_--