react-admin-firebase icon indicating copy to clipboard operation
react-admin-firebase copied to clipboard

Display list very slow

Open matthieup240 opened this issue 2 years ago • 7 comments

I have a list with about 20k lines. To display this list, this take a very long time. Is there a solution to resolve this inconvenient ? Thanks

matthieup240 avatar Oct 19 '22 06:10 matthieup240

This is a common issue, try enabling LazyLoading via:

const dataProvider = FirebaseDataProvider(firebaseConfig, {
  lazyLoading: {
    enabled: true,
  },
});

Related to #59

benwinding avatar Oct 20 '22 01:10 benwinding

Thanks, I have tried it but when I want to do a filter, the values not already available are not founded. Is there a solution about filters with lazyLoading enabled ?

matthieup240 avatar Oct 20 '22 12:10 matthieup240

Is there a solution with the new "count" result announced last week at the Firebase Submit ?

matthieup240 avatar Oct 24 '22 19:10 matthieup240

I experienced the same problem with slow lists and I can't yet enable lazyLoading because of the problems with filters too. I used a permanent filter as a workaround. I added this to the List component:

filter={{ collectionQuery: c => c.where('orderDate', '>=', aWeekAgo).where('orderDate', '<=', today) }}

adrianbruegger avatar Nov 06 '22 21:11 adrianbruegger

Thanks for your answer. Don't understand your query. Could you adding some details please ? What is orderDate ? Is it like CreatedAt ?

matthieup240 avatar Nov 07 '22 17:11 matthieup240

Yes, orderDate is like a CreateAt. The whole List component looks like this:

<List actions={<ListActions />} filters={orderFilter} filter={{ collectionQuery: c => c.where('orderDate', '>=', aWeekAgo).where('orderDate', '<=', today) }} sort={{ field: 'orderDate', order: 'DESC' }} {...props}>

Hope it helps.

adrianbruegger avatar Nov 09 '22 08:11 adrianbruegger

Ok thanks. But with this filter, I have no result....

matthieup240 avatar Nov 09 '22 18:11 matthieup240