If you have a Notion database with a relation column and you change the sort order of the relation field, you may notice that the entire database recalculates. This can cause a brief delay, especially in large databases with hundreds or thousands of rows. The root cause is how Notion stores and resolves relation data internally. This article explains why a sort on a relation column forces a full re-calculation and what you can do to minimize performance impact.
Key Takeaways: Relation Sort and Database Performance
- Relation sort triggers a full database re-calculation: Notion recalculates every row in the database when you sort by a relation column because relation values are resolved dynamically at query time.
- Rollup and formula columns amplify the delay: If your database includes rollups or formulas that depend on the relation, each row recalculates those as well during the sort.
- Use a dedicated sort column to avoid frequent re-calculation: Create a formula or rollup column that extracts the relation value you want to sort by, then sort that column instead.
Why Sorting a Relation Column Recalculates the Entire Database
In Notion, a relation column does not store the actual value you see in the cell. Instead, it stores a reference to the related page ID. When you view the database, Notion resolves each relation reference by fetching the linked page’s properties. This resolution happens on the fly every time the database is loaded or sorted.
When you apply a sort to a relation column, Notion must resolve the relation for every row in the database to determine the sort order. This is because the sort algorithm needs a concrete value (like a page title or date) from the related page to compare rows. Without a pre-cached value, Notion recalculates each row’s relation cell. The process is similar to a database join in SQL: the system fetches and compares data from two tables for each row.
How Relation Resolution Works
Each relation cell contains a list of page IDs. When Notion renders the database, it sends a query to fetch the titles (or other properties) of those linked pages. This query is cached briefly for normal viewing. But a sort operation invalidates that cache because the sort order depends on the resolved value. Notion must re-query the linked pages for every row to build a sorted result set.
Why This Affects Large Databases More
If your database has 500 rows and each row has a relation to one page, Notion makes up to 500 additional queries to resolve the related page titles. For databases with rollups or formulas that reference the relation, each row triggers additional calculations. The total time scales linearly with row count. Databases with more than 1,000 rows can experience a noticeable delay of several seconds.
Steps to Reduce the Impact of Relation Sorting
You cannot prevent the re-calculation entirely because of how Notion resolves relations. But you can change your workflow to avoid sorting the relation column directly. The following method uses a helper column to store the resolved value permanently.
- Create a formula column to extract the relation value
Add a formula column to your database. Use theprop()function to reference the relation column. For example, if your relation column is named “Project,” create a formula withprop("Project").first().nameto get the first linked page’s title. This formula resolves the relation value and stores it as text in the formula cell. - Sort by the formula column instead of the relation column
Apply your sort to the new formula column. Because the formula value is computed once when the page is edited, Notion does not need to re-query the relation for sorting. The sort operation uses the stored formula value, which is much faster. - Remove unnecessary rollups and formulas that depend on the relation
If you have rollup columns that aggregate relation data (like “Project Status” from a rollup), each sort on the relation column forces those rollups to recalculate. Consider moving rollup values into a formula column that resolves only the specific property you need for sorting. - Limit the number of rows displayed in the view
Use filters to show only the rows you need. For example, filter by a date range or status. A smaller dataset reduces the number of relation resolutions during a sort. Click the “Filter” button at the top of the database view and add a condition that limits the rows.
If Notion Still Has Performance Issues After the Main Fix
Sorting Still Feels Slow Even With a Formula Column
If your formula column contains a complex expression (like prop("Relation").map(current.prop("Name")).join(", ")), the formula itself may be slow to evaluate. Simplify the formula to extract only the first value or a single property. For example, use prop("Relation").first().name instead of mapping all linked pages.
Database Has Too Many Relation Columns
Each relation column in a database adds overhead during any sort operation. If you have three or more relation columns, consider removing unused ones. You can also move relations to a separate linked database and use a lookup formula to bring in only the needed value.
Rollup Column Causes Recalculation of All Rows
A rollup column that aggregates data from a relation (like “Count of Tasks” or “Sum of Hours”) forces Notion to recalculate the rollup for every row when the database is sorted. To avoid this, remove the rollup column from the view or replace it with a formula that computes the value only when you open the page.
Relation Sort vs Formula Sort: Performance Compared
| Item | Sort on Relation Column | Sort on Formula Column (resolved value) |
|---|---|---|
| Resolution method | Fetches linked page data for each row at sort time | Uses pre-computed value stored in the formula cell |
| Rows affected | All rows in the database view | Only rows that have changed since last edit |
| Speed with 500 rows | 1–3 seconds typical delay | Under 0.5 seconds |
| Speed with 2,000 rows | 5–10 seconds typical delay | 1–2 seconds |
| Impact on rollups | Forces all rollups to recalculate | No impact on rollups unless formula references them |
| Cache behavior | Invalidates relation cache for the view | Uses formula cache, no relation cache invalidation |
Sorting on a formula column that stores the resolved relation value is consistently faster than sorting directly on the relation column. The difference becomes more noticeable as the database grows.
You now understand why sorting a relation column triggers a full database re-calculation and how to work around it. Create a formula column that extracts the relation value you need for sorting. Apply your sort to that formula column instead of the relation column. For databases with more than 1,000 rows, this single change can reduce sort time from several seconds to under one second.