Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example queries #77

Open
yoid2000 opened this issue Oct 27, 2022 · 5 comments
Open

Example queries #77

yoid2000 opened this issue Oct 27, 2022 · 5 comments
Assignees

Comments

@yoid2000
Copy link
Contributor

If we don't have example queries that the user can use as a template for his/her own queries, then users won't know how to use the system.

I'd like to have a set of example queries created whenever a user adds a table. There should be enough queries that a user can most likely find a query that more-or-less does what the user wants to do, but not so many that the user can't find an appropriate query even when it exists. The example queries should do the following:

  1. Cover most of the functions that we provide.
  2. Provide enough templates so that usually a user only needs to find a template, change the column / aggregation values, and move forward.

It would be super useful if this process resulted in the initial page of Metabase showing a few of these queries under the heading "Pick up where you left off" (rather than the normal original page to explore data, which fails if the data is anonymized). Not sure if that is possible, since the page is populated with examples of previous queries that the user wrote.

One source of example queries are the queries at training.open-diffix.org.

I don't think we need to necessarily provide queries that are directly useful to the user. This would be hard to do in any event. I think more important is that we provide examples, and that the user can look through a reasonable list of query titles and pick out the most appropriate template, and then just make small changes to it.

Then the changed query can be saved as a new query:

image

In Metabase, we could have one "Collection" per table. Each collection then has a number of sample queries and associated visualizations, and maybe one dashboard containing the examples. Each per-table collection can be a sub-folder in an "Examples" folder, like this:

image

I think we could have for instance the following examples:

  • Count distinct column
  • Count rows (histogram, 2 columns)
  • Count protected entities (histogram, 1 column)
  • Sum column and average column in same query
  • Numeric generalization (use a column with many distinct numeric values)
  • Datetime generalization
  • Substring (perhaps together in one query with numeric generalization)
  • WHERE clause
  • A query with substantial suppression (if we can find a column with man distinct numeric values)
@pdobacz
Copy link
Collaborator

pdobacz commented Oct 27, 2022

Should we make this contingent on the revamped sample data issue #75 ?

(Also note that Datetime generalization is continent on #23 as well as will not work for all generalizations supported by Metabase due to diffix/pg_diffix#455)

@yoid2000
Copy link
Contributor Author

Should we make this contingent on the revamped sample data issue #75 ?

Not sure what you mean by "contingent". Certainly they are related...

@yoid2000
Copy link
Contributor Author

(Also note that Datetime generalization is continent on #23 as well as will not work for all generalizations supported by Metabase due to diffix/pg_diffix#455)

Ok. Yes if datetime import doesn't work, we certainly can't have datetime examples!

@pdobacz
Copy link
Collaborator

pdobacz commented Oct 27, 2022

Should we make this contingent on the revamped sample data issue #75 ?

Not sure what you mean by "contingent". Certainly they are related...

I've just meant that we tackle #75 first and build the sample queries against the sample data after. Or both issues in parallel by same person, so queries and data fit each other.

@yoid2000
Copy link
Contributor Author

I see. It is not clear to me that the order matters...

In fact, it seems they could be done at the same time by different people without all that much coordination.

If the sample tables simply appear as any other table that the user imports, then the example queries could be written independently...

@edongashi edongashi self-assigned this Oct 28, 2022
This was referenced Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants