morningman opened a new issue #375: Support TRUNCATE TABLE stmt
URL: https://github.com/apache/incubator-doris/issues/375
 
 
   # Description
    
   Currently, Doris only offers 2 two ways to empties a table or partition:
   
   1. Using DELETE stmt
   
       User can use DELETE stmt, and specify a delete range condition to cover 
the entire table or partition. This operation is quick, but may cause some 
performance impact. Because the actual data deletion is happened in the 
background base compaction process. Before the base compaction is finished, all 
queries to that table or partition may have an extra cost on filtering the 
delete condition.
   
   2. Drop the table(partition) and add it again
   
       This is a recommended way to empties the table(partition), because it is 
quick and has no performance impact. But Drop-n-Add is not an atomic operation, 
so user may "lose the table(partition)" for a short time, which is not friendly 
to user.
   
   # TRUNCATE TABLE
   
   Supporting a new operation: TRUNCATE, which can empty the table(partition) 
quickly without any performance impact.
   
   Usage:
       `TRUNCATE TABLE tbl [PARTITION(p1, p2, ...)];`
   
   Notes:
   
   1. Only support truncate OLAP table.
   2. Table's state should be NORMAL, not in schema change or other meta 
operation.
   3. Table(partition) should not has unfinished load jobs.
   
   # Implementation
   
   1. Create partitions with same schema but different tablets.
   2. Add the newly created partitions to catalog, to replace the old 
partitions.
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to