mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 11:03:36 +08:00
Add logs in the recompression code path
We added a few diagnostic log messages in the compression/decompression code paths some time ago and they have been useful in identifying hotspots in the actual activities. Adding a few more for recompression now. The row_compressor_append_sorted_rows function which is also used in recompression is already logged so we need just a few log messages here.
This commit is contained in:
parent
60c9f4d246
commit
6e01b8c581
@ -1088,9 +1088,17 @@ recompress_chunk_segmentwise_impl(Chunk *uncompressed_chunk)
|
|||||||
* on the updated tuple in the CHUNK table potentially preventing other transaction
|
* on the updated tuple in the CHUNK table potentially preventing other transaction
|
||||||
* from updating it
|
* from updating it
|
||||||
*/
|
*/
|
||||||
ts_chunk_clear_status(uncompressed_chunk,
|
if (ts_chunk_clear_status(uncompressed_chunk,
|
||||||
CHUNK_STATUS_COMPRESSED_UNORDERED | CHUNK_STATUS_COMPRESSED_PARTIAL);
|
CHUNK_STATUS_COMPRESSED_UNORDERED | CHUNK_STATUS_COMPRESSED_PARTIAL))
|
||||||
|
ereport(LOG,
|
||||||
|
(errmsg("cleared chunk status for recompression: \"%s.%s\"",
|
||||||
|
NameStr(uncompressed_chunk->fd.schema_name),
|
||||||
|
NameStr(uncompressed_chunk->fd.table_name))));
|
||||||
|
|
||||||
|
ereport(LOG,
|
||||||
|
(errmsg("acquiring locks for recompression: \"%s.%s\"",
|
||||||
|
NameStr(uncompressed_chunk->fd.schema_name),
|
||||||
|
NameStr(uncompressed_chunk->fd.table_name))));
|
||||||
/* lock both chunks, compressed and uncompressed */
|
/* lock both chunks, compressed and uncompressed */
|
||||||
/* TODO: Take RowExclusive locks instead of AccessExclusive */
|
/* TODO: Take RowExclusive locks instead of AccessExclusive */
|
||||||
Relation uncompressed_chunk_rel = table_open(uncompressed_chunk->table_id, ExclusiveLock);
|
Relation uncompressed_chunk_rel = table_open(uncompressed_chunk->table_id, ExclusiveLock);
|
||||||
@ -1190,6 +1198,10 @@ recompress_chunk_segmentwise_impl(Chunk *uncompressed_chunk)
|
|||||||
|
|
||||||
/* Index scan */
|
/* Index scan */
|
||||||
Relation index_rel = index_open(row_compressor.index_oid, ExclusiveLock);
|
Relation index_rel = index_open(row_compressor.index_oid, ExclusiveLock);
|
||||||
|
ereport(LOG,
|
||||||
|
(errmsg("locks acquired for recompression: \"%s.%s\"",
|
||||||
|
NameStr(uncompressed_chunk->fd.schema_name),
|
||||||
|
NameStr(uncompressed_chunk->fd.table_name))));
|
||||||
|
|
||||||
index_scan = index_beginscan(compressed_chunk_rel, index_rel, snapshot, 0, 0);
|
index_scan = index_beginscan(compressed_chunk_rel, index_rel, snapshot, 0, 0);
|
||||||
TupleTableSlot *slot = table_slot_create(compressed_chunk_rel, NULL);
|
TupleTableSlot *slot = table_slot_create(compressed_chunk_rel, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user