Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lazy loading from SQLite

I have some 4500 entries in my database. What is the best way to show them in a ListView. Should I load them all in one stretch when the application initializes or should I use lazy loading? The list will also be searchable and filterable. Could you also point me to some nice articles that would gimme a better idea. Please do give me suggestions.

like image 367
Ragunath Jawahar Avatar asked Oct 24 '10 15:10

Ragunath Jawahar


People also ask

Does EF core use lazy loading by default?

Lazy Loading is the default behavior of LINQ that's why it is the default behavior of EF Core. With lazy loading, all related entities are not loaded along with the parent entity automatically.

How do I use lazy loading in Entity Framework?

Lazy loading means delaying the loading of related data, until you specifically request for it. When using POCO entity types, lazy loading is achieved by creating instances of derived proxy types and then overriding virtual properties to add the loading hook. Lazy loading is pretty much the default.

What is lazy loading in .NET core?

Lazy loading means that the related data is transparently loaded from the database when the navigation property is accessed.


1 Answers

I would like to point you to here first but I also have some experience I would like to share.

First, showing anything more than say 500 items in a list is probably going to cause users to complain (maybe not though). Users can get overwhelmed with info and it gets annoying for users to scroll to see all of the data (even with filters because some users will refuse to use them if they can scroll).

Second, the data adapter in Android is pretty smart so an adapter over thousands of items will be handled smoothly due to the way Android caches views and iterates through a result set with a cursor which is the subject of that link I pointed you to at the start of my answer.

like image 115
Andrew White Avatar answered Oct 08 '22 07:10

Andrew White