1. Vladimir Esipov
  2. Valentina Studio
  3. Воскресенье, Сентябрь 08 2024, 09:22 AM
  4.  Подписаться через email
Perhaps, similar to VDB, the following information could be added to the right panel:

Database panel
To pane Database Setting add:
Database_ID
Comment
Database type
Access metod (RW, RO)
Storage Type (Disk, RAM)
Segment Size

This could be retrieved from a query:
FROM duckdb_databases() WHERE NOT internal;


To pane INFORMATION add:
DB Actual Size
DB Used Size
DB Free Size
Memory Used
Memory Limit

This could be retrieved from a query:

SELECT database_size as DB_SIZE,
formatReadableSize(block_size * used_blocks) as USED_SIZE,
formatReadableSize(block_size * free_blocks) as FREE_SIZE,
formatReadableSize(block_size) as BLOCK_SIZE,
memory_usage AS MEM_USED,
memory_limit as MEM_MAX
FROM pragma_database_size();


To Table panel INFORMATION add:
Table Size

This could be retrieved from a query:

select 'table_name' as table_name,
count(distinct block_id) as num_blocks, -- число блоков
formatReadableSize(count(distinct block_id) * (select block_size from pragma_database_size())) as num_bytes -- размер таблицы
from pragma_storage_info('table_name')
group by all;
Комментарий
There are no comments made yet.
Vladimir Esipov Ответ принят
When importing a database, comments are not saved. This is not a claim to VDB, this is the default behavior of the EXPORT command of the DuckDB engine.
But, it is still advisable to save in the schema.sql file comments to objects that are in the source database, since restoring them is a tedious matter.
Comments can be for any objects except the database, schema, and objects with dependencies.
Comments can be read by querying the comment column of the respective metadata functions
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello Vladimir,

Thanks for the info!

Yes, comments are missing in the EXPORT command, and there is a feature request. However, it seems the developer missed the part about comments.

In Valentina Studio, we retrieve comments and display them as properties and include them in SQL scripts and SQL dumps.
Ссылки
  1. https://github.com/duckdb/duckdb/discussions/13178
Комментарий
There are no comments made yet.
Vladimir Esipov Ответ принят
In Valentina Studio, we retrieve comments and display them as properties and include them in SQL scripts and SQL dumps.

I'm actually talking about VStudio 14.5b16.
In the current version, when you execute the BackUp or Create Dump commands, comments are not saved.
But if you ask VS to generate a table creation script, the script contains comments.
If you have already implemented this feature in the new version of - great!

In the developer version of DuckDB 1.1. this function is not yet implemented.
DBeaver also does not have this feature.
Комментарий
There are no comments made yet.
Vladimir Esipov Ответ принят
Hi, Sergey and the team!
I see you're writing a cheat sheet - how to implement connection initialization and execute an arbitrary script via the connection form. Very convenient!
And I'm stupid - how come I didn't think of this before?:(

I'm struggling with the possibility of getting information about the table field sizes and compression ratio. There are no native functions, like in Clickhouse, and it's not so easy to extract from Pragma_storage_info() - different blocks of the same field can be compressed by different codecs, depending on the nature of the data...
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Ah, you're right; comments were not included in the custom SQL dump. This has been fixed.

Yes, changes to the initialization scripts will be available in the next build.
These scripts are saved in bookmarks.
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories