Home > database >  Consult everybody, partition table 1 billion line, the data do not how to operate?
Consult everybody, partition table 1 billion line, the data do not how to operate?

Time:10-10

The inside of the business is still there, but the data is not important, you can delete all, to rebuild table, how to operate better

CodePudding user response:

Table will be built inside the original partition table space, table structure index of these should be retained

CodePudding user response:

Partition information, alter table table_name truncate partition (p1) update the indexes; This isn't foolproof

CodePudding user response:

The plan is a lot of, probably a few:
1, modify the name of the table to rebuild,
2, delete the table again,
3, truncate directly, this time is bad to say, although all say this is very fast, but the actual operation, there is slow,
4, 2 #, according to a district truncate (if there is partition)

CodePudding user response:

reference 3 floor selling fruit net reply:
this solution is a lot of, probably a few:
1, modify the name of the table to rebuild,
2, delete the table again,
3, truncate directly, this time is bad to say, although all say this is very fast, but the actual operation, there is slow,
4, 2 #, according to a district truncate (if there is partition)
the third method is the most simple? How to ensure index is not a problem?

CodePudding user response:

reference 4 floor lzhw8811282 response:
Quote: reference 3 floor selling fruit net reply:

The plan is a lot of, probably a few:
1, modify the name of the table to rebuild,
2, delete the table again,
3, truncate directly, this time is bad to say, although all say this is very fast, but the actual operation, there is slow,
4, 2 #, according to a district truncate (if there is partition)
the third method is the most simple? How to ensure index is not a problem?


Can rebuild index alter index XXX rebuild partition p script specific see actual situation

CodePudding user response:

Is afraid of index a problem? Can't start on it now

CodePudding user response:

Truncate a global index update is added to the indexes;
If is partitioning index is not affected,

CodePudding user response:

A problem is deleted to rebuild index, afraid of what, direct copy of the original table table SQL including index, and then drop table purge, rebuild table, all directly to go

CodePudding user response:

The safest if worried, I think it is renamed, then a new table,
  • Related