Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[data grid] Handle 1m records #240

Open
oliviertassinari opened this issue Sep 2, 2020 · 4 comments
Open

[data grid] Handle 1m records #240

oliviertassinari opened this issue Sep 2, 2020 · 4 comments
Labels
component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 2, 2020

I have been wondering about this aspect. I believe the limitation for displaying, say 1m records is the number of pixels the browser accepts. This is discussed in bvaughn/react-virtualized#396 and WICG/display-locking#49.

How about we automatically trigger the pagination if a user exceeds this limit? It would also be great to document it.

Another thought, in such a case, the server might not even know how many rows they are. With PostgreSQL a simple count(*) on a table with many rows can be too time-consuming to be used in production. We would need to handle this case, the case where the total number of rows is unknown.

Proof: https://codesandbox.io/s/beautiful-silence-1yifo?file=/src/App.js

We document the limitation at: https://material-ui.com/components/data-grid/virtualization/.

Benchmark

@oliviertassinari oliviertassinari changed the title [RFC] How to handle 1m records? [DataGrid] Handle 1m records Sep 4, 2020
@oliviertassinari oliviertassinari added component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request and removed discussion labels Sep 4, 2020
@mak-elena
Copy link

I'm currently testing DataGrid component and huge data sets (without pagination) are exacly the case I'm interested in.
In this regard: Do you consider to implement a behavior similar to react-virtualized/InfiniteLoader?

Or alternatively:
The ColumnApi has the method getVisibleColumns (BTW, it returns always all the columns. Is it still under implementation? )
Is it possible to have a similar method for rows? So that prefetching and caching of data requred for rendering can be implemented on top of it.

Thanks.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Oct 6, 2020

@mak-elena We definitely plan to introduce lazy loading for the rows. Right now the only alternative I'm aware of is to set pagination={true}. This new data fetch API will support sorting, filtering, search, grouping, etc.

@oliviertassinari
Copy link
Member Author

It would also be great to document it.

Done in https://material-ui.com/components/data-grid/rendering/#virtualization

Browsers set a limit on the number of pixels a scroll container can host: 17.5 million pixels on Firefox, 33.5 million pixels on Chrome, Edge, and Safari. A reproduction.

@oliviertassinari
Copy link
Member Author

@mak-elena You can track and upvote #404.

@oliviertassinari oliviertassinari added the waiting for 👍 Waiting for upvotes label Jun 1, 2022
@oliviertassinari oliviertassinari changed the title [DataGrid] Handle 1m records [data grid] Handle 1m records May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes
Projects
None yet
Development

No branches or pull requests

2 participants