If I have 2 indexed fields(X, Y both doubles) and I have query
SELECT *
FROM locations LIMIT 10
WHERE x < 25.65434 AND x > 23.54654
AND y < 37.67345 AND y > 32.98564
what is the time complexity for this query. If there is just 1 query it would have been O(log(n)) but given that there are 2 fields I could not think of any data structure which can solve in O(log(n)). How do sql databases store the indexes and how do they search if the query is on 2 fields like I mentioned above.