Skip to content

Conversation

@andr-sokolov
Copy link
Contributor

@andr-sokolov andr-sokolov commented Nov 20, 2025

This extension is useful to find out how much disk space is occupied by
temporary tables and which user created them in which session.
The extension tracks the creation and deletion of temporary table files on
segments. The list of files is stored in the shared memory of each segment.
If memory allocated using ShmemInitStruct is not enough, the extension uses DSM.
The extension adds the tts_get_seg_files function to get the tracked files,
their sizes, user and session where they was created from segments.
Add the ic-temp_tables_stat test for the extension.

@andr-sokolov andr-sokolov marked this pull request as ready for review November 20, 2025 08:29
@andr-sokolov andr-sokolov requested a review from NJrslv November 20, 2025 09:01
* last_prev_node != NULL because last_node is not head.
* next_node() has been called, so the mapping exists.
*/
dsm_detach(dsm_find_mapping(last_prev_node->next));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not so sure if it is safe to call dsm_detach while holding a lock, because dsm_detach calls user defined callbacks and so forth.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user defined callbacks are not used. What are potential problems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants