WolfgangFahl / snapquery

Frontend to Introduce Named Queries and Named Query Middleware to wikidata
Apache License 2.0
4 stars 1 forks source link

Query statistics #17

Closed WolfgangFahl closed 1 month ago

WolfgangFahl commented 2 months ago
cd .solutions/snapquery/storage/
sqlite3 named_queries.db "DELETE FROM QueryStats WHERE duration = 0.5;"
sqlite3 named_queries.db "SELECT query_id,COUNT(duration),MIN(duration), MAX(duration), AVG(duration) FROM QueryStats group by query_id;"
author-curation_missing-author-resolving|0|||
author-curation_missing-citing-author-items|0|||
author_list-of-publications|4|0.483572|0.89197|0.693051
wikidata-examples.cats|1|0.5|0.5|0.5
WolfgangFahl commented 2 months ago

query_stats

query

SELECT query_id, 
  COUNT(duration) AS count, 
  MIN(duration) AS min_time, 
  MAX(duration) AS max_time, 
 AVG(duration) AS avg_time, 
  MIN(records) AS min, 
  MAX(records) AS max, 
  AVG(records) AS avg 
FROM QueryStats 
GROUP by query_id 
ORDER BY 1 DESC; 

result

query_id count min_time max_time avg_time min max avg
snapquery-examples.cats 1 0.5 0.5 0.5 223 223 223.0
cats 2 0.4 0.4 0.4 200 205 202.5
author_list-of-publications 2 0.4 1.4 0.9 30 60 45.0