Jerry Ajay
Oliver Kennedy, Geoff Challen, Luke Ziarek
The average smartphone evaluates
about 180 queries per day
That's about 2 queries every second.
~200 UB students, faculty, and staff using instrumented LG Nexus 5 smartphones in exchange for discounted service.
SELECT
statementsINSERT
statementsUPDATE
statementsDELETE
statements
INSERT OR REPLACE INTO
properties(property_key,property_value)
VALUES (?,?);
SELECT property_value
FROM properties
WHERE property_key=?;
(These are actual queries from the trace)
pers = Persons.get(10)
name = pers.firstName()
SELECT first_name
FROM Persons
WHERE id = 10;
SQL DB persists objects between app runs
pers = Persons.get(10)
org = pers.employer()
name = org.name()
SELECT employer_id
FROM Persons
WHERE id = 10;
SELECT name
FROM Organizations
WHERE id = ?;
ORMs are not always efficient
pers = Persons.get(10)
pers.setSalary(
pers.salary() * 1.1
)
SELECT salary
FROM Persons
WHERE id = 10;
UPDATE Persons
SET salary = ?
WHERE id = 10;
We saw NO update value computations in SQL
pers = Persons.get(10)
pers.setSalary(
pers.salary() * 1.1
)
SELECT salary
FROM Persons
WHERE id = 10;
INSERT OR REPLACE Persons
SET salary = ?
WHERE id = 10;
"Insert or Replace" used very frequently
Function | Call Sites |
---|---|
GROUP_CONCAT | 583,474 |
SUM | 321,387 |
MAX | 314,970 |
COUNT | 173,031 |
MIN | 19,566 |
AVG | 15 |
Aggregates by-far the most common function type
Function | Call Sites |
---|---|
GROUP_CONCAT | 583,474 |
SUM | 321,387 |
MAX | 314,970 |
COUNT | 173,031 |
MIN | 19,566 |
AVG | 15 |
Non-algebraic column-wise string concatenation
Mostly string manipulation (length, substr
)
Some Android-Specific (phone_numbers_equal
)
NO UDFs at all
15-20% of queries arrive ~10ms after last query.
Let us know how you would use PocketData!