I have a table with around 50 million rows.
Tablename: iddetails
Columns: nid, mid, pid, cid
Unique Key : Combination of mid, pid, cid columns
I need to load this data unto java application and perform search operations
My approach: Represent the data as a List of Maps.
List<Map<String, Long>> mList = new ArrayList<>();
To Search for any of mId, pId, cId and retrieve the nId
for (Map<String, Long> mp : mList) {
if(mp.get("pId")==99999) {
System.out.println("nId : "+mp.get("nId"));
System.out.println("mId : "+mp.get("mId"));
System.out.println("pId : "+mp.get("pId"));
System.out.println("cId : "+mp.get("cId"));
break;
}
}
This solution is working.
But I want to know is: Are there any better approaches than this, performance wise.
Edit: nId, instead of name.