Results 1 to 1 of 1
- iPhone Nanite
- 1 Posts
Ios :- Core data and predicate on large volume.
In one of my current project requirement is to view product information in particular date range.
No. Of products :- P1 P2 P3 P4 P5
No of channels....:- C1 C2 C3 C4
No of regions :- R1 R2 R3 R4
Depending on any of the above combination user can select either "Daily" "Weekly" "Monthly" "Yearly" for daily for Perticular date there will be (5 produtcts *4 channel*4 regions)= 80 Combinations
Daily :- so for 5 years it will be (80*365*5=1,46, 000) records
Montly:- for 5 years :- 12 *5 = 60 so total 4800 records.
quarterly for 5 years :- 4 *5 = 20 so total (20*80) =1600 records.
That means we can calculate all daily, monthly, quarterly and yearly using daily data.
As user can vary the selected combination of products, channels and regions and can also select the date range.
Looking at the search criteria, we decided to load the data into core data and then use predicate to fetch the data.
Day :- On perticular date
Weekly :- On friday i.e. end of week
Monthly :- 31/30 month end date
Quarterly :- March end date , Jun end date etc.
Yearly 31st dec date
But my question is:
1.Can we use Daily model to fetch also monthly, quarterly and yearly information. Memory optimization good vs response time less 2. Separate data model for Daily , Monthly and quarterly. (Yearly we can calculate from quarterly). [Response time good but duplicate data]
Yes we can use date predicates .But our concern was is CoreData that efficient to query such large data considering we have number of combinations on product region and channel. We can use IN predicaate for(product region and channel) .If it was Oracle we would have definitely gone for only Daily data model.
Could anyone please suggest which is the best option to model this data?
- By vp_ortiz in forum iOS 6Replies: 15Last Post: 10-07-2012, 10:23 AM
- By ImranJ in forum iOS 5Replies: 1Last Post: 01-11-2012, 04:05 PM
- By appalert143 in forum iPhone Apps & GamesReplies: 0Last Post: 01-11-2012, 06:04 AM
- By iamPAULTOT in forum iPhone 3GS ForumReplies: 6Last Post: 01-03-2012, 05:37 AM
- By iRoo in forum iOS 5Replies: 0Last Post: 12-30-2011, 01:41 AM