Skip to content

Commit ba5fb80

Browse files
Merge pull request #2446 from MicrosoftDocs/main638677014238483890sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents f43c370 + 6203dfb commit ba5fb80

20 files changed

+300
-230
lines changed

data-explorer/.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
"redirect_url": "/sql/azure-data-studio/notebooks/notebooks-kqlmagic?context=/azure/data-explorer/context/context",
2626
"redirect_document_id": false
2727
},
28+
{
29+
"source_path": "delete-data.md",
30+
"redirect_url": "/kusto/concepts/delete-data?view=azure-data-explorer&preserve-view=true",
31+
"redirect_document_id": false
32+
},
2833
{
2934
"source_path": "connect-from-databricks.md",
3035
"redirect_url": "/azure/data-explorer/spark-connector",
@@ -425,6 +430,11 @@
425430
"redirect_url": "/kusto/set-timeout-limits?view=azure-data-explorer&preserve-view=true",
426431
"redirect_document_id": false
427432
},
433+
{
434+
"source_path": "debug-inline-python.md",
435+
"redirect_url": "/kusto/debug-inline-python",
436+
"redirect_document_id": false
437+
},
428438
{
429439
"source_path": "excel-connector.md",
430440
"redirect_url": "/azure/data-explorer/excel",

data-explorer/debug-inline-python.md

Lines changed: 0 additions & 95 deletions
This file was deleted.

data-explorer/delete-data.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

data-explorer/kusto/.openpublishing.redirection.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"redirect_document_id": false
2727
},
2828
{
29-
"source_path": "concepts/delete-data.md",
30-
"redirect_url": "/azure/data-explorer/delete-data",
29+
"source_path": "data-explorer/delete-data.md",
30+
"redirect_url": "/kusto/concepts/delete-data",
3131
"redirect_document_id": false
3232
},
3333
{

data-explorer/kusto/concepts/data-soft-delete.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ description: This article describes data soft delete.
44
ms.reviewer: slneimer
55
ms.topic: reference
66
ms.date: 08/11/2024
7-
monikerRange: "azure-data-explorer"
7+
monikerRange: "azure-data-explorer || microsoft-fabric"
88
---
99
# Soft delete overview
1010

11-
> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)]
11+
> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)]
1212
1313
The ability to delete individual records is supported. Record deletion is commonly achieved using one of the following methods:
1414

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
title: Delete data
3+
description: This article describes delete scenarios, including purge, dropping extents and retention based deletes.
4+
ms.reviewer: avneraa
5+
ms.topic: how-to
6+
ms.date: 10/11/2024
7+
---
8+
# Delete data
9+
10+
> [!INCLUDE [applies](../includes/applies-to-version/applies.md)] [!INCLUDE [fabric](../includes/applies-to-version/fabric.md)] [!INCLUDE [azure-data-explorer](../includes/applies-to-version/azure-data-explorer.md)]
11+
12+
Delete data from a table is supported in several ways. Use the following information to help you choose which deletion method is best for your use case.
13+
14+
:::moniker range="azure-data-explorer"
15+
| Use case | Considerations | Method |
16+
|--|--|--|
17+
| Delete all data from a table. | | [Use the `.clear table data` command](#delete-all-data-in-a-table) |
18+
| Routinely delete old data. | Use if you need an automated deletion solution. | [Use a retention policy](#delete-data-using-a-retention-policy) |
19+
| Bulk delete specific data by extents. | Only use if you're an expert user. | [Use the `.drop extents` command](#delete-data-by-dropping-extents) |
20+
| Delete records based on their content. | - Storage artifacts that contain the deleted records aren't necessarily deleted. <br /> - Deleted records can't be recovered (regardless of any retention or recoverability settings). <br />- Use if you need a quick way to delete records. | [Use soft delete](#soft-delete)|
21+
| Delete records based on their content. | - Storage artifacts that contain the deleted records are deleted. <br /> - Deleted records can't be recovered (regardless of any retention or recoverability settings). <br />- Requires significant system resources and time to complete. | [Use purge](#purge) |
22+
:::moniker-end
23+
24+
:::moniker range="microsoft-fabric"
25+
| Use case | Considerations | Method |
26+
|--|--|--|
27+
| Delete all data from a table. | | [Use the `.clear table data` command](#delete-all-data-in-a-table) |
28+
| Routinely delete old data. | Use if you need an automated deletion solution. | [Use a retention policy](#delete-data-using-a-retention-policy) |
29+
| Bulk delete specific data by extents. | Only use if you're an expert user. | [Use the `.drop extents` command](#delete-data-by-dropping-extents) |
30+
| Delete records based on their content. | - Storage artifacts that contain the deleted records aren't necessarily deleted.<br /> - Deleted records can't be recovered (regardless of any retention or recoverability settings).<br />- Use if you need a quick way to delete records. | [Use soft delete](#delete-individual-rows) |
31+
:::moniker-end
32+
33+
The following sections describe the different deletion methods.
34+
35+
## Delete all data in a table
36+
37+
To delete all data in a table, use the [.clear table data](../management/clear-table-data-command.md) command. This command is the most efficient way to remove all data from a table.
38+
39+
Syntax:
40+
41+
```kusto
42+
.clear table <TableName> data
43+
```
44+
45+
## Delete data using a retention policy
46+
47+
Automatically delete data based on a [retention policy](../management/retention-policy.md). You can set the retention policy at the database or table level. There's no guarantee as to when the deletion occurs, but it will not be deleted before the retention period. This is an efficient and convenient way to remove old data.
48+
49+
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:
50+
51+
```kusto
52+
.alter-merge database <DatabaseName> policy retention softdelete = 60d
53+
54+
.alter-merge table <TableName> policy retention softdelete = 60d
55+
```
56+
57+
## Delete data by dropping extents
58+
59+
[Extent (data shard)](../management/extents-overview.md) 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](../management/drop-extents.md).
60+
61+
### Examples
62+
63+
You can delete all rows in a table or just a specific extent.
64+
65+
- Delete all rows in a table:
66+
67+
```kusto
68+
.drop extents from TestTable
69+
```
70+
71+
- Delete a specific extent:
72+
73+
```kusto
74+
.drop extent e9fac0d2-b6d5-4ce3-bdb4-dea052d13b42
75+
```
76+
77+
## Delete individual rows
78+
79+
:::moniker range="azure-data-explorer"
80+
Both purge and soft delete can be used for deleting individual rows. Soft delete doesn't necessarily delete the storage artifacts that contain records to delete, and purge does delete all such storage artifacts.
81+
82+
Both methods prevent deleted records from being recovered, regardless of any retention or recoverability settings. The deletion process is final and irreversible.
83+
84+
### Soft delete
85+
86+
With [soft delete](data-soft-delete.md), data isn't necessarily deleted from storage artifacts. This method marks all matching records as deleted, so that they'll be filtered out in queries, and doesn't require significant system resources.
87+
88+
### Purge
89+
90+
With [purge](data-purge.md), extents that have one or more records to be deleted, are replaced with new extents in which those records don't exist. This deletion process isn't immediate, requires significant system resources, and can take a whole day to complete.
91+
::: moniker-end
92+
93+
:::moniker range="microsoft-fabric"
94+
[Soft delete](data-soft-delete.md) can be used for deleting individual rows. Data isn't necessarily deleted from storage artifacts. Soft delete prevent deleted records from being recovered, regardless of any retention or recoverability settings. The deletion process is final and irreversible. This method marks all matching records as deleted, so that they'll be filtered out in queries, and doesn't require significant system resources.
95+
::: moniker-end

0 commit comments

Comments
 (0)