Working of OR operation?
Let the database be:
Create table if not exists maintable (rowid INTEGER PRIMARY KEY, puid INTEGER)
Create Unique Index if not exists puididx on maintable (puid)
Assume a query
"select rowid from maintable where puid = X OR puid = Y or puid = Z"
How will this query work internally?
1 Will it first check the index table for puid = X and get the rowid, then followed by checking the index table for puid = Y, then puid =Z.
2 Will it first check each row puid and match it with X then Y then Z and then move to the second row in maintable? (Without referring to the index table)
3 Will it first check for puid = X in the maintable then check for puid = Y in the maintable and then for puid =z.
4 Any other way
Regards,
Phani
__________________
Regards,
Phani
|