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

Do something with this column changes query #40

Open
simonw opened this issue Dec 6, 2021 · 1 comment
Open

Do something with this column changes query #40

simonw opened this issue Dec 6, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation research

Comments

@simonw
Copy link
Owner

simonw commented Dec 6, 2021

This query shows which columns are most frequently updated, ignoring those for version = 1

select columns.name, count(*)
from item_changed
  join item_version on item_changed.item_version = item_version._id
  join columns on item_changed.column = columns.id
where item_version._version > 1
group by columns.name
order by count(*) desc

Maybe turn this into a view?

@simonw simonw added documentation Improvements or additions to documentation research labels Dec 6, 2021
@simonw
Copy link
Owner Author

simonw commented Dec 8, 2021

I used this in my blog post: https://simonwillison.net/2021/Dec/7/git-history/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation research
Projects
None yet
Development

No branches or pull requests

1 participant