A
A
Artem Nazarov2020-03-10 08:40:08
1C
Artem Nazarov, 2020-03-10 08:40:08

How can I check the size of the elements of the 1s file base?

We have a regular 1C file base installed. We started working with this configuration recently, but the database has grown from 2 GB to 4 in a few weeks. The question is, how can you look at the size of individual database objects in order to determine why it has grown so much?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sgr_A, 2020-03-10
@very_very_good_day

Filebase table sizes Filebase table sizes
8.3

I
idShura, 2020-03-10
@idShura

You connect to the database server using SQL Server Management Studio (SSMS) and execute the SQL query:

SELECT t.NAME AS TableName,
       s.Name AS SchemaName,
       p.rows,
       SUM(a.total_pages) * 8 AS TotalSpaceKB, 
       CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,
       SUM(a.used_pages) * 8 AS UsedSpaceKB, 
       CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB, 
       (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB,
       CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS UnusedSpaceMB
FROM sys.tables t
INNER JOIN  sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN sys.partitions p ON i.object_id = p.OBJECT_ID 
                           AND i.index_id = p.index_id
INNER JOIN sys.allocation_units a ON p.partition_id = a.container_id
LEFT JOIN sys.schemas s ON t.schema_id = s.schema_id
WHERE t.NAME NOT LIKE 'dt%' 
  AND t.is_ms_shipped = 0
  AND i.OBJECT_ID > 255 
GROUP BY t.Name, 
         s.Name, 
         p.Rows
ORDER BY  TotalSpaceMB DESC, 
          t.Name

K
Konstantin, 2020-03-10
@fosihas

There is one more trick if the configuration was removed from support. increases at the same time.

L
LollyFox, 2020-03-12
@LollyFox

It would be nice to voice the version of the configuration that swelled up to 4GB in a few weeks + mention the typical configuration or someone tried to edit it with their playful pens + make sure that this is exactly the size of the database (file 1Cv8.1CD), and not the logs (folder 1Cv8Log ).
If this is the Integrated Automation configuration (I don’t think that someone would start running ERP in file mode, which is even harder), or you have several people like pianists hammering in documents all day, or the configuration was changed, or someone caring downloaded FIAS All Russ, or... (didn't remember), then 4GB may be quite a normal size for your case and you should think about switching to SQL.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question