---
title: "[Xray] - Guide to checking Xray data size"
canonical: "https://docs.getxray.app/space/ProductKB/140476478/%5BXray%5D%20-%20Guide%20to%20checking%20Xray%20data%20size"
format: markdown
---
This documentation aims to guide our customers in checking the amount of data they have for each Xray issue type. It also helps assess the size of their Jira instance, providing insight into the volume of data to be migrated to the Cloud.

**First option**:

Since the Xray DC version 8.2.2,** the  Xray Dependency map** shows which projects are linked and helps you identify which ones can be migrated in groups. Also, this shows you the total of Xray data for all the groups, etc.

- You can find this in the **Xray Preflight screen** under *Manage Apps > Xray > Cloud Migration*. Please also share the **dependency map** **with the Xray Support team in a CSV format. **

 **Second option:**

- Running SQL queries in your database to know the size of your Xray instance in the DC. **Please also share the results with the Xray Support team in a CSV format. **

```
SELECT
    p.pname,
    p.pkey,
    COUNT(CASE WHEN it.pname = 'Test' THEN 1 END) AS test_count,
    COUNT(CASE WHEN it.pname = 'Pre-Condition' THEN 1 END) AS pre_condition_count,
    COUNT(CASE WHEN it.pname = 'Test Set' THEN 1 END) AS test_set_count,
    COUNT(CASE WHEN it.pname IN ('Test Execution', 'Sub Test Execution') THEN 1 END) AS test_execution_count,
    COUNT(CASE WHEN it.pname = 'Test Plan' THEN 1 END) AS test_plan_count,
    COALESCE(tr.test_run_count, 0) AS test_run_count,
    COUNT(ao.ID) AS num_attachments,
    ROUND(SUM(CAST(ao.FILE_SIZE AS NUMERIC) / 1048576), 2) AS total_filesize_MB
FROM project p
JOIN jiraissue j ON p.id = j.project
JOIN issuetype it ON it.id = j.issuetype
LEFT JOIN AO_8B1069_ATTACHMENT ao ON ao.ISSUE_ID = j.id
LEFT JOIN (
    SELECT
        ji.project,
        COUNT(*) AS test_run_count
    FROM AO_8B1069_TEST_RUN tr
    JOIN jiraissue ji ON tr.TEST_EXEC_ISSUE = ji.id
    GROUP BY ji.project
) tr ON tr.project = p.id
GROUP BY p.pkey, p.pname, tr.test_run_count
UNION ALL
SELECT
    'TOTAL' AS pname,
    '' AS pkey,
    SUM(test_count),
    SUM(pre_condition_count),
    SUM(test_set_count),
    SUM(test_execution_count),
    SUM(test_plan_count),
    SUM(test_run_count),
    SUM(num_attachments),
    SUM(total_filesize_MB)
FROM (
    SELECT
        COUNT(CASE WHEN it.pname = 'Test' THEN 1 END) AS test_count,
        COUNT(CASE WHEN it.pname = 'Pre-Condition' THEN 1 END) AS pre_condition_count,
        COUNT(CASE WHEN it.pname = 'Test Set' THEN 1 END) AS test_set_count,
        COUNT(CASE WHEN it.pname IN ('Test Execution', 'Sub Test Execution') THEN 1 END) AS test_execution_count,
        COUNT(CASE WHEN it.pname = 'Test Plan' THEN 1 END) AS test_plan_count,
        COALESCE(tr.test_run_count, 0) AS test_run_count,
        COUNT(ao.ID) AS num_attachments,
        ROUND(SUM(CAST(ao.FILE_SIZE AS NUMERIC) / 1048576), 2) AS total_filesize_MB
    FROM project p
    JOIN jiraissue j ON p.id = j.project
    JOIN issuetype it ON it.id = j.issuetype
    LEFT JOIN AO_8B1069_ATTACHMENT ao ON ao.ISSUE_ID = j.id
    LEFT JOIN (
        SELECT
```

**Third option: **

- To check the size of your data, run the following queries in your database:

```
select count(*) from jiraissue j join issuetype as it on (it.id=j.issuetype) where it.pname='Test';
```

```
select count(*) from jiraissue j join issuetype as it on (it.id=j.issuetype) where it.pname in ('Test Execution', 'Sub Test Execution');
```

```
select count(*) from jiraissue j join issuetype as it on (it.id=j.issuetype) where it.pname='Test Plan';
```

```
select count(*) from "AO_8B1069_TEST_RUN";
```

```
select count(*) from jiraissue j join issuetype as it on (it.id=j.issuetype) where it.pname in ('Test Execution', 'Sub Test Execution');
```

```
select count(*) from jiraissue j join issuetype as it on (it.id=j.issuetype) where it.pname='Test Plan';
```

```
select count(*) from "AO_8B1069_TEST_RUN";
```

For the Attachment size, please check: [How to get Xray Attachments size info on Jira Data Center?](https://getxraydocs.atlassian.net/wiki/spaces/ProductKB/pages/46269215)