Skip to content

Delete data

Delete data with DELETE or by dropping chunks from a hypertable in your database using SQL

Row deletes use the standard DELETE statement against a hypertable. This works the same whether the chunk is in the rowstore or the columnstore. You don't need to decompress a chunk before deleting from it: TimescaleDB decompresses only the rows your statement touches, not the whole chunk. When you need to age out large ranges, dropping chunks or using a retention policy is usually cheaper than massive DELETE scans.

Try this with your AI agent

In Tiger Cloud, set up Tiger MCP and ask your AI agent to do this for you. See example prompts to get started, and best practices to keep it safe.

To delete data from a table, use the syntax DELETE FROM .... In this example, data is deleted from the table conditions, if the row's temperature or humidity is below a certain level:

DELETE FROM conditions WHERE temperature < 35 OR humidity < 60;
Tips

If you delete a lot of data, run VACUUM or VACUUM FULL to reclaim storage from the deleted or obsolete rows.

TimescaleDB allows you to delete data by age, by dropping chunks from a hypertable. You can do so either manually or by data retention policy.

To learn more, see the data retention section.