The Ancestry_TreeData table holds one row of tree summary metadata per person GUID — how big the tree is, whether it is public, private, unlinked, or absent. Where Ancestry_matchTrees stores the individual people in a tree, this table stores the high-level facts about the tree as a whole.
There is exactly one row per GUID: TestGuid carries a unique constraint. The GUID identifies whose tree is being described — usually a match, and sometimes your own kit.
| Column | Type | Source | Description |
|---|---|---|---|
| Id | int (PK) | Auto | Auto-incrementing primary key |
| TestGuid | string (unique) | Compare | The GUID whose tree this row describes (the dictionary key from the tree-data response). Stored uppercased. One row per GUID. |
| TreeSize | int | Compare | Number of people in the tree (nullable; from treeSize) |
| PublicTree | bool | Compare | True if the tree is public (from isPublicTree) |
| PrivateTree | bool | Compare | True if the tree is private (from isPrivateTree) |
| UnlinkedTree | bool | Compare | True if a tree exists but no person is linked as the DNA tester (from isUnlinkedTree) |
| NoTrees | bool | Compare | True if this person has no tree at all (from hasNoTrees) |
| TreeUnavailable | bool | Compare | True if a tree exists but could not be accessed/retrieved (from isTreeUnavailable) |
| TreeId | string | Legacy | Tree identifier. The current tree-data response does not supply this, so it is written as null; an existing non-null value is preserved on re-gather. |
NoTrees = true will have a 0 / false elsewhere, while a private linked tree shows PrivateTree = true with a populated TreeSize. Use the combination to decide whether tree-based analysis is worthwhile for a given match.Rows are written during per-match Compare/tree gathering. The tree-data endpoint returns a dictionary keyed by GUID; for each entry the app builds one Ancestry_TreeData row and upserts it. The response is processed only when tree gathering visits compare pages — a matches-only gather leaves this table empty.
Writes are an upsert keyed on TestGuid: if a row already exists for the GUID it is updated in place, otherwise a new row is inserted. The one preserved field is TreeId — because the current response no longer supplies it, a previously stored TreeId is carried forward rather than being overwritten with null. The save path also guards against the unique-constraint race that can occur when two tree-data responses for the same GUID arrive together, falling back to an update of the row that won the race.
matchTreeNodeCount and matchTreeIsPrivate fields mirror the same underlying tree facts at the match level.