Skip to content
Source
Sign inSign up
TanStack/db

Poor performance for nested includes #1634

Send to my agent
Closedsamvantoever(GitHub profile, opens in a new tab) opened this issue 1 comment
  • I've validated the bug against the latest version of DB packages

Describe the bug When creating a query with includes that is multiple levels deep, the time to run useLiveQuery significantly increases up to 100ms on my machine (m1 macbook pro).

To Reproduce

db-perf-test.tsx

Steps to reproduce the behavior: I've created a tanstack-router route that contains a test to simulate the problem.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version 149.0.7827.197
  1. We reproduced the reported nested shape and added a regression oracle and benchmark. The query creates the expected 260 nested materializations, with no duplicate or discarded facade construction. Nested includes increase work in proportion to the number of correlated queries they represent. We found no includes-specific amplification bug. Further speedups would be general query/materialization performance work and should be tracked separately.

Sign in to join this conversation.