Skip to content

Commit 2ae27eb

Browse files
committed
added more thorough documentation
1 parent 0534f4d commit 2ae27eb

1 file changed

Lines changed: 61 additions & 86 deletions

File tree

Documentation/addressables-build-reports.md

Lines changed: 61 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -12,92 +12,82 @@ The Addressables build data is stored across multiple related tables in the SQLi
1212

1313
## Concepts
1414

15-
**Builds** - a build is
15+
**Builds** - a build corresponds to a content build. This can be part of a player build, or standalone through the Addressables groups window
16+
**Bundles** - asset bundles that are output by the build.
17+
**Groups** - groups in the Addressable Groups window whose settings generate one or more Asset Bundles
18+
**Schemas** - settings for groups that determine how bundles are generated
19+
**Files** - the file in the asset bundle that contains serialized files
20+
**SubFiles** - files that are bundled in the asset bundle, but not stored with the rest of the serialized files (resS, scene sharedAssets)
1621
**Explicit Assets** - these are assets that have had the Addressable checkbox checked in the Editor
17-
18-
22+
**Other Assets** - these are assets that are included because an explcit asset depends upon them
1923

2024
### Core Tables
2125

2226
#### `addr_builds`
23-
Main build information table containing:
24-
- Build metadata (target, start time, duration, errors)
25-
- Unity and Addressables version information
26-
- Build script and result hash
27-
- Build type (new build vs. update)
28-
29-
#### `addr_build_bundles`
30-
Bundle-level information including:
31-
- Asset counts and file sizes
32-
- Compression settings and CRC values
33-
- Load paths and provider information
34-
- Dependency file sizes (compressed and expanded)
35-
- Internal name (filename used in Unity cache)
36-
- Build status and result types
37-
38-
#### `addr_build_cached_bundles`
39-
A view that contains the filename of the built bundle and the name it is stored in the Unity runtime cache.`
27+
Main build information table
28+
* id maps to build_id in other tables
4029

4130
#### `addr_build_groups`
42-
Addressables group configuration:
43-
- Group names and GUIDs
44-
- Packing mode settings
45-
- Associated bundles and schemas
46-
47-
#### `addr_build_files`
48-
File-level details within bundles:
49-
- MonoScript counts and sizes
50-
- Bundle object information
51-
- Preload information sizes
52-
- File names and result filenames
53-
54-
### Asset and Reference Tables
55-
56-
#### `addr_build_explicit_assets`
57-
Explicit Addressable assets. These are assets that have had the Addressables checkbox checked. With:
58-
- Asset paths and addresses
59-
- GUID and internal ID information
60-
- Size information (serialized and streamed)
61-
- Asset type and labeling information
62-
63-
#### `addr_build_explicit_asset_labels`
64-
Labels that have been assigned to explict addresable asses.
31+
Contains groups used in the build and whether they're pack separate or together.
32+
* guid maps to group_guid in other tables
33+
34+
#### `addr_build_group_schemas`
35+
Map groups to their schemas
36+
* schema_rid maps to addr_group_schemas.id
37+
* group_id maps to addr_build_groups.id
6538

6639
#### `addr_build_schemas`
67-
Group schema configurations:
68-
- Schema types and GUIDs
69-
- Configuration data pairs
40+
Contain schema names.
41+
* id maps to addr_group_schemas.id
42+
43+
#### `add_build_schema_data_pairs`
44+
Contains key value pairs of schema settings at time of build.
45+
* schema_id maps to addr_build_schemas.id
46+
47+
#### `addr_build_bundles`
48+
Bundle-level information including asset counts and file sizes.
49+
50+
#### `addr_build_bundle_dependent_bundles
51+
Maps bundles to the bundles they depend upon (dependent bundles will be loaded as long as the bundle in question is loaded).
52+
* bundle_id maps to addr_build_bundles.id
53+
* dependent_bundle_rid maps ot addr_build_bundles.id
7054

71-
#### `addr_build_sub_files`
72-
Sub-file information:
73-
- File sizes and serialization status
74-
- Relationship to parent files
55+
#### `addr_build_bundle_files`
56+
List files in bundles. These are the serialized files and external files.
57+
* bundle_id maps to addr_build_bundles.id
58+
* file_rid maps to addr_build_files.id
7559

76-
### Relationship Tables
60+
### `addr_build_explicit_assets`
61+
Explicit assets (marked as Addressable). Has Addressable name and asset information including paths.
62+
* bundle maps to addr_build_bundles.id
63+
* group_guid maps to addr_build_groups.guid
64+
* file maps to addr_build_files.id
7765

78-
The system includes several junction tables to maintain relationships:
79-
- `addr_build_bundle_dependencies`: Bundle-to-bundle dependencies
80-
- `addr_build_bundle_files`: Bundle-to-file relationships
81-
- `addr_build_group_bundles`: Group-to-bundle associations
82-
- `addr_build_group_schemas`: Group-to-schema relationships
83-
- `addr_build_explicit_asset_labels`: Asset labeling information
84-
- `addr_build_file_assets`: File-to-asset associations
66+
### `addr_build_explicit_asset_internal_referenced_other_assets`
67+
Map explicit assets to other assets they refer to. For instance a prefab to its underlying FBX
68+
* referencing_asset_rid maps to addr_build_explicit_assets.id
69+
* data_from_other_asset_Id maps to addr_build_data_from_other_assets.id
8570

86-
## Usage
71+
### `addr_build_data_from_other_assets`
72+
Assets added into the build implicitly by explictly defined assets.
73+
* file maps to addr_build_files.id
74+
75+
#### `addr_build_cached_bundles`
76+
A view that contains the filename of the built bundle and the name it is stored in the Unity runtime cache.
8777

8878
### Basic Analysis
8979

9080
To analyze Addressables build reports in your project:
9181

9282
```bash
9383
# Analyze all files in a directory (automatically detects Addressables JSON files)
94-
UnityDataTools.exe "C:\MyProject\ServerData" -o "addressables_analysis.db"
84+
UnityDataTools.exe "Library\com.unity.addressables\BuildReports\" -o "addressables_analysis.db"
9585
9686
# Include verbose output to see processing details
97-
UnityDataTools.exe "C:\MyProject\ServerData" -o "addressables_analysis.db" --verbose
87+
UnityDataTools.exe "Library\com.unity.addressables\BuildReports\" -o "addressables_analysis.db" --verbose
9888

9989
# Analyze only JSON files specifically
100-
UnityDataTools.exe "C:\MyProject\ServerData" -o "addressables_analysis.db" -p "*.json"
90+
UnityDataTools.exe "C:\Temp\MyExtractedFiles" -o "addressables_analysis.db" -p "*.json"
10191
```
10292

10393
You can analyze a directory with both asset bundles (*.bundle) and json files (*.json) at the same time.
@@ -106,13 +96,21 @@ You can analyze a directory with both asset bundles (*.bundle) and json files (*
10696

10797
Once the data is in the database, you can run queries to analyze your Addressables build:
10898

99+
#### Find the cache name for an addressables bundle
100+
```sql
101+
-- Find cache name for an addressables bundle
102+
SELECT cached_name
103+
FROM addr_build_cached_bundles
104+
WHERE catalog_name = 'packedassets7_assets_all_61d3358060e969d3aad2d9c5c3a7d69b.bundle';
105+
109106
#### Bundle Size Analysis
110107
```sql
111108
-- Find largest bundles by file size
112109
SELECT name, file_size, asset_count, compression
113110
FROM addr_build_bundles
114111
ORDER BY file_size DESC
115112
LIMIT 10;
113+
```
116114

117115
#### Build Performance Analysis
118116
```sql
@@ -133,29 +131,6 @@ FROM addr_builds
133131
WHERE error IS NOT NULL AND error != '';
134132
```
135133

136-
#### Asset and Dependency Analysis
137-
```sql
138-
-- Find assets with the most references
139-
SELECT
140-
asset_path,
141-
addressable_name,
142-
serialized_size,
143-
streamed_size
144-
FROM addr_build_explicit_assets
145-
ORDER BY (serialized_size + streamed_size) DESC
146-
LIMIT 20;
147-
148-
-- Analyze bundle dependencies
149-
SELECT
150-
b1.name as bundle,
151-
b2.name as depends_on,
152-
b2.file_size as dependency_size
153-
FROM addr_build_bundle_dependencies bd
154-
JOIN addr_build_bundles b1 ON bd.bundle_id = b1.id AND bd.build_id = b1.build_id
155-
JOIN addr_build_bundles b2 ON bd.dependency_rid = b2.id AND bd.build_id = b2.build_id
156-
ORDER BY b1.name, b2.file_size DESC;
157-
```
158-
159134
#### MonoScript Analysis
160135
```sql
161136
-- Analyze MonoScript distribution across files
@@ -168,4 +143,4 @@ FROM addr_build_files f
168143
JOIN addr_build_bundles b ON f.bundle = b.id AND f.build_id = b.build_id
169144
WHERE f.mono_script_count > 0
170145
ORDER BY f.mono_script_size DESC;
171-
```
146+
```

0 commit comments

Comments
 (0)