Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
TroubleshootingNovember 22, 20266 min read

Why is my app slow with lots of data?

An app that slows down as data grows almost always loads or draws too much at once. Here is how to find which part is slow and the fix for each.

Startbase Team
Editorial ink illustration of an overstuffed card catalog drawer spilling index cards, the brass tab of one card in ember orange

Key takeaways

  • The most common cause is loading every row in one request and drawing every row on screen. Paginate to about 50 rows per page as a starting point.
  • The second is a filter or sort on a column with no index. One index often turns a multi-second query into milliseconds.
  • Measure before you fix: time the request in the browser network panel, then the database query, then the rendering.

If your app was quick with a few dozen records and now takes seconds to open a list, the most likely cause is that it fetches every row and renders every row on each visit. That worked at 80 rows and breaks at 8,000. The second most likely cause is a search, filter or sort on a column the database has no index for. Both are fixable in an afternoon, and neither means you need a bigger server.

The trick is to find which layer is slow before changing anything. A slow app is slow in one of three places: the database query, the trip over the network, or the browser drawing the result. Each has a different fix, and fixing the wrong one wastes a day.

First, find the slow layer

Open the page in a desktop browser, open the developer tools, and reload with the Network tab open. Find the request that returns your list (it usually has the table name in the URL). Look at two numbers:

  • Waiting time (also called time to first byte). Long waiting means the database or a server function is slow.
  • Size and download time. A response of several megabytes means you are sending too much data, even if the query itself is quick.
  • If the request finishes in 200 milliseconds but the page still freezes for two seconds afterward, the problem is rendering, not data.

Tip

Test with realistic data. A list that feels fine with 30 seed rows tells you nothing. Ask for 10,000 fake rows in a test project or a copy of your table and measure there.

The causes, most likely first

1. No pagination: every row, every time

The classic first version of a list asks for the whole table: `select * from orders`. With 20,000 orders, that is 20,000 rows serialized, sent and parsed on every page view. Supabase APIs also cap a single response (1,000 rows by default), so past that point the app is not just slow, it quietly shows an incomplete list.

How to check: count the items in the response from the Network tab, or look for a query with no `limit` or `range`. The fix: show 50 rows per page as a starting value, with either page buttons or "load more" on scroll. For lists people scroll through quickly, such as a feed, cursor pagination (fetch the next 50 rows older than the last one you showed) stays fast at any depth, while page-number offsets get slower the deeper you go.

2. Filtering or sorting a column with no index

Without an index, a query like "orders for this customer, newest first" makes the database read the entire table to find the matching rows. At 1,000 rows nobody notices. At 500,000 it takes seconds. Indexes are the database equivalent of the tab on a card catalog drawer.

How to check: in Startbase Cloud, the Security section of the Backend tab runs performance advisors alongside its security checks, and flags slow patterns. You can also run `explain analyze` on the slow query in the SQL editor and look for "Seq Scan" on a big table. The fix: add an index on the columns you filter by, in the order you filter and sort. For "this customer, newest first" that is one index on `(customer_id, created_at desc)`. Foreign key columns such as `user_id` or `project_id` almost always deserve one.

3. One query per row (the N+1 problem)

A list of 50 orders that then fetches each customer's name separately makes 51 requests. Each takes maybe 40 milliseconds, and the browser runs only a handful at once, so the page fills in over two seconds while rows pop in one by one.

How to check: the Network tab shows dozens of near-identical requests after the first one. The fix: fetch related data in the same query. Supabase can embed related rows in one request (orders with their customer), or you can create a database view that joins the tables and read from that.

4. Drawing thousands of elements

Even with the data in hand, a browser asked to draw 5,000 table rows with avatars, badges and buttons will stutter, especially on phones. Each row might be 30 elements, so that is 150,000 nodes to lay out.

How to check: the request is fast but the page freezes, and scrolling feels heavy. The fix: paginate (cause 1), or for genuinely long lists use virtualization, which only draws the 20 or 30 rows currently on screen and swaps their content as you scroll. A sensible rule of thumb: plain rendering is fine below a few hundred rows, and virtualization is worth it above about 500.

5. Selecting columns you never show

`select *` on a table with a long `description` text column or a JSON blob sends kilobytes per row that the list never displays. The fix: select only the columns the list shows, and load the heavy ones when someone opens a single record.

6. Access rules that run a subquery on every row

Row-level security policies run for each row a query touches. A policy like "show this row if the user belongs to the row's team" that does a lookup in a `team_members` table without an index on that table repeats the lookup thousands of times. The fix: index the columns the policy looks up (`team_members(user_id, team_id)`), and keep policies simple. Supabase's own guidance is to write `(select auth.uid())` in policies so the user ID is computed once per query rather than once per row; the performance advisors flag this pattern.

7. Counting and totals computed in the browser

A dashboard that downloads every sale to add them up in JavaScript gets slower every day you are in business. The fix: let the database compute sums and counts (`sum`, `count`, `group by`) in a view or a server function and return one small row. For heavy totals that do not need to be live to the second, a scheduled job can recompute them every few minutes into a summary table.

Search is its own case

A search box that runs `ilike '%term%'` across 100,000 rows cannot use a normal index, because the match can start anywhere in the text. Three fixes, in order of effort:

  1. 01Wait until the person stops typing for about 300 milliseconds before searching, so you send one query instead of eight.
  2. 02Search only the columns that matter (title and customer name, not every text field).
  3. 03Use Postgres full-text search with a dedicated index for large tables. It handles word forms and ranking too.

What to send the Startbase agent

The agent works in your backend directly: it can read your schema, add indexes as migrations, and rewrite queries and list components. It does best with the measurements you took. Paste the table name, row count and timings, like this:

The Orders page takes about 4 seconds to load. The orders table has about 25,000 rows and the request returns all of them (3.2 MB). Please: 1) paginate the list at 50 rows per page with cursor pagination on created_at, 2) select only the columns the list shows, 3) fetch the customer name in the same query instead of one request per row, 4) add indexes for the filters the page uses (customer_id and status, sorted by created_at desc) as a migration, and 5) run the backend performance advisors and fix anything they flag on these tables. Show me the before and after timing.

If the fix makes things worse, open Versions in the top bar and restore the version from before the change; restoring saves your current files first, so nothing is lost. Then ask for one change at a time. More on that rhythm in checkpoints and undo.

Build it right the next time

When you describe a new list screen, say how big it will get: "this will hold tens of thousands of rows, paginate it and index the filters." The agent then builds for scale from the first version instead of the 30 rows of seed data it can see. If you are newer to tables and keys, database basics for non-developers and what an index-friendly primary key looks like are short reads that make this easier to spot. And if the slowness is on first page load rather than on lists, that is a different problem: caching and bundle size, covered in what is caching.

Frequently asked questions

How many rows is too many for a web app?

There is no hard limit on the database side; Postgres handles millions of rows comfortably with indexes. The limit is what you send and draw at once. As a starting point, keep each request under a few hundred rows and each screen under about 500 drawn rows without virtualization.

Will upgrading my plan make the app faster?

Rarely, for this problem. A missing index or an unpaginated list is slow on any server. Fix the query and the rendering first; only consider a bigger database when measurements show the database itself is at capacity.

Why does my list stop at 1,000 items?

Supabase APIs return at most 1,000 rows per request by default. If your app requests the whole table, anything past that is silently missing. Paginate instead of raising the cap.

Do indexes have a downside?

Each index takes some storage and makes writes slightly slower, because the index updates too. For most apps that read far more than they write, a handful of indexes on filtered columns is a clear win. Do not index every column.

On this page

  • First, find the slow layer
  • The causes, most likely first
  • Search is its own case
  • What to send the Startbase agent
  • Build it right the next time

Keep reading

More in Troubleshooting
Editorial ink illustration of a border checkpoint with a lowered barrier arm and a waiting parcel, the guard's stamp in ember orange
TroubleshootingNovember 22, 2026

CORS errors explained and fixed

A CORS error means the server you called did not say your website is allowed to read its answer. The fix lives on that server, or in a server function you control.

5 min read
Editorial ink illustration of a brass street sign on a lamppost with a blank second sign being fitted, the bolt in ember orange
TroubleshootingNovember 22, 2026

Custom domain not working: a checklist

A custom domain fails for a short list of reasons: the record is wrong, it has not propagated, an old record conflicts, or you connected the root domain where only www works.

5 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.