Records count:
db=# select count(*) from data_logs ;
count
-----------
141184654
(1 row)
Trying to del old records:
db=# SELECT drop_chunks(interval '36 hours', 'data_logs');
drop_chunks
-------------
(1 row)
Records still in table :
db=# select count(*) from data_logs;
count
-----------
141295446
(1 row)
The function drop_chunks will only delete a chunk if all of its records are older than the specified time threshold.
http://docs.timescale.com/v0.9/api#drop_chunks
Do you have chunks for which that is true? You can get the time ranges of your chunks via this function:
http://docs.timescale.com/v0.9/api#chunk_relation_size_pretty
Otherwise, if you need specific rows deleted, you can always use DELETE, it's just much less efficient for bulk deletion.
@ya-jeks , did @mfreed 's response answer your question (I see your thumbs up reaction :) ). If so, can I close this?
@RobAtticus, yes. Thank you )
Most helpful comment
The function drop_chunks will only delete a chunk if all of its records are older than the specified time threshold.
http://docs.timescale.com/v0.9/api#drop_chunks
Do you have chunks for which that is true? You can get the time ranges of your chunks via this function:
http://docs.timescale.com/v0.9/api#chunk_relation_size_pretty
Otherwise, if you need specific rows deleted, you can always use
DELETE, it's just much less efficient for bulk deletion.