QueryVis: Logic-Based Diagrams Help Users Understand Complicated SQL Queries Faster
Channel: Northeastern University Data Visualization
Date: 2020-06-11

QueryVis is a novel visualization tool that reduces the time needed to read and understand SQL queries. Our diagrams are minimal in that no visual element is superfluous; they are unambiguous in that no two queries with different semantics map to the same visualization; and they extend previously existing visual representations of relational schemata and conjunctive queries in a natural way.

For more info please see our website at https://queryvis.com/ and our paper with all supplemental materials at https://osf.io/btszh/ 

Citation:
Aristotelis Leventidis, Jiahui Zhang, Cody Dunne, Wolfgang Gatterbauer,  H.V.  Jagadish,  and  Mirek  Riedewald, "QueryVis: Logic-based  diagrams  help  users  understand  complicated  SQL queries faster," inProc. 2020 ACM SIGMOD International Conference on Management of Data (SIGMOD ’20), 2020. doi: 10.1145/3318464.3389767 preprint and materials doi: 10.31219/osf.io/btszh

Abstract: Understanding the meaning of existing SQL queries is critical for code maintenance and reuse. Yet SQL can be hard to read, even for expert users or the original creator of a query. We conjecture that it is possible to capture the logical intent of queries in automatically-generated visual diagrams that can help users understand the meaning of queries faster and more accurately than SQL text alone.

We present initial steps in that direction with visual diagrams that are based on the first-order logic foundation of SQL and can capture the meaning of deeply nested queries. Our diagrams build upon a rich history of diagrammatic reasoning systems in logic and were designed using a large body of human-computer interaction best practices: they are minimal in that no visual element is superfluous; they are unambiguous in that no two queries with different semantics map to the same visualization; and they extend previously existing visual representations of relational schemata and conjunctive queries in a natural way. An experimental evaluation involving 42 users on Amazon Mechanical Turk shows that with only a 2--3 minute static tutorial, participants could interpret queries meaningfully faster with our diagrams than when reading SQL alone. Moreover, we have evidence that our visual diagrams result in participants making fewer errors than with SQL. We believe that more regular exposure to diagrammatic representations of SQL can give rise to a pattern-based and thus more intuitive use and re-use of SQL.

A full version of this paper with all appendices and supplemental material for the experimental study (stimuli, raw data, and analysis code) are available at https://osf.io/btszh

Keywords: SQL, query visualization, first-order logic, network visualization, quantitative evaluation, databases.