I am creating a data model in greenDAO. This is the port of the iOS application that uses Core Data. In iOS, we use indexes (indexes?) To increase search performance in a table of 20 columns (properties), where 5 columns are often requested. I know that this leads to additional storage and provides slow write to the table.
Delving into the documentation, I came across the addIndex (Index index) method in Entity and the index () method in Property.PropertyBuilder . What is the correct way to add an index to Entity?
Entity entity = schema.addEntity("entity"); entity.setSuperclass("SuperClass"); entity.addIdProperty(); entity.addIntProperty("property").index();
or
Entity entity = schema.addEntity("entity"); entity.setSuperclass("SuperClass"); entity.addIdProperty(); Property property = entity.addIntProperty("property").getProperty(); entity.setIndex(property);
Or are they both doing the same thing?
android orm greendao
Ralph pina
source share