Skip to content

Commit 80946d4

Browse files
authored
Merge pull request #107444 from orspod/2020-3-delete-data
changes in delete data topic
2 parents 19b317e + d89d137 commit 80946d4

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

articles/data-explorer/delete-data.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,51 @@
11
---
22
title: Delete data from Azure Data Explorer
3-
description: This article describes bulk delete scenarios in Azure Data Explore, including purge and retention based deletes.
3+
description: This article describes delete scenarios in Azure Data Explorer, including purge, dropping extents and retention based deletes.
44
author: orspod
55
ms.author: orspodek
6-
ms.reviewer: mblythe
6+
ms.reviewer: avneraa
77
ms.service: data-explorer
88
ms.topic: conceptual
9-
ms.date: 09/24/2018
9+
ms.date: 03/12/2020
1010
---
1111

1212
# Delete data from Azure Data Explorer
1313

14-
Azure Data Explorer supports several bulk delete approaches, which we cover in this article. It doesn't support per-record deletion in real time, because it's optimized for fast read access.
14+
Azure Data Explorer supports various delete scenarios described in this article.
1515

16-
* If one or more tables is no longer needed, delete them using the drop table or drop tables command.
16+
## Delete data using the retention policy
1717

18-
```Kusto
19-
.drop table <TableName>
18+
Azure Data Explorer automatically deletes data based on the [retention policy](/azure/kusto/management/retentionpolicy). This method is the most efficient and hassle-free way of deleting data. Set the retention policy at the database or table level.
2019

21-
.drop tables (<TableName1>, <TableName2>,...)
22-
```
20+
Consider a database or table that is set for 90 days of retention. If only 60 days of data are needed, delete the older data as follows:
21+
22+
```kusto
23+
.alter-merge database <DatabaseName> policy retention softdelete = 60d
24+
25+
.alter-merge table <TableName> policy retention softdelete = 60d
26+
```
27+
28+
## Delete data by dropping extents
29+
30+
[Extent (data shard)](/azure/kusto/management/extents-overview) is the internal structure where data is stored. Each extent can hold up to millions of records. Extents can be deleted individually or as a group using [drop extent(s) commands](/azure/kusto/management/extents-commands#drop-extents).
2331

24-
* If old data is no longer needed, delete it by changing the retention period at the database or table level.
32+
### Examples
2533

26-
Consider a database or table that is set for 90 days of retention. Business needs change, so now only 60 days of data is needed. In this case, delete the older data in one of the following ways.
34+
You can delete all rows in a table or just a specific extent.
2735

28-
```Kusto
29-
.alter-merge database <DatabaseName> policy retention softdelete = 60d
36+
* Delete all rows in a table:
3037

31-
.alter-merge table <TableName> policy retention softdelete = 60d
38+
```kusto
39+
.drop extents from TestTable
3240
```
3341
34-
For more information, see [Retention policy](https://docs.microsoft.com/azure/kusto/concepts/retentionpolicy).
42+
* Delete a specific extent:
43+
44+
```kusto
45+
.drop extent e9fac0d2-b6d5-4ce3-bdb4-dea052d13b42
46+
```
47+
48+
## Delete individual rows using purge
49+
50+
[Data purge](/azure/kusto/management/data-purge) can be used for deleting individuals rows. Deletion isn't immediate and requires significant system resources. As such, it's only advised for compliance scenarios.
3551
36-
If you need assistance with data deletion issues, please open a support request in the [Azure portal](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview).

0 commit comments

Comments
 (0)