freelawproject / courtlistener

A fully-searchable and accessible archive of court data including growing repositories of opinions, oral arguments, judges, judicial financial records, and federal filings.
https://www.courtlistener.com
Other
548 stars 150 forks source link

Move docket view count out of docket model #3346

Open mlissner opened 1 year ago

mlissner commented 1 year ago

Right now we tally a count to the docket table every time somebody views a docket. I'm sorry to say this is a bad idea. Looking up, locking, and then incrementing a row on a table of this size every time somebody loads the page is difficult. In fact, I've noticed that this query is our worst query according to AWS:

image

(You can't really tell, but it's the first one you see there.)

I'm not sure the best fix for this:

We should do something though, I'm afraid....

mlissner commented 3 months ago

By the way, the freelawproject/infrastructure#204 will also fix this problem when we do it (at the cost of losing the accuracy of this stat).