Commit Graph

396 Commits

Author SHA1 Message Date
Klaas van Schelven
0dfd01db9b Performance: don't evaluate all project issues to show/hide checkbox
Doing so is expensive (to the point of timeout) for largish numbers
of issues.
2025-05-06 23:01:09 +02:00
Klaas van Schelven
aad0f624f9 Fix: issue-list indexes must have project first
because we always filter by project before ordering;

the now-removed first_seen index was simply unused
2025-05-06 22:19:31 +02:00
Klaas van Schelven
49e6700d4a Grouping.grouping_key: hash it for the index 2025-05-06 11:32:19 +02:00
Klaas van Schelven
3783661054 Issue Paginator: don't attempt to count the Issues
Counting incurs looking at all records which is too expensive if you have e.g.
1_000_000 issues.

Note that we take a different approach than the one for Events (where we
count-with-timeout). Reason for switching:
https://sqlite.org/forum/forumpost/fa65709226

For Events we have a known count for the non-query case (denormalized/counted
value), so we preserve what we had there. For Issues the trouble of keeping
counts right for muted/etc. is not (currently) worth it.
2025-05-06 10:13:06 +02:00
Klaas van Schelven
392f5a30be Add index for Grouping.grouping_key (and project) 2025-05-05 22:45:33 +02:00
Klaas van Schelven
cddd4f2c02 Fix Header/Grouper for Log Messages using deprecated SDKs
Fix #85
2025-04-24 20:59:54 +02:00
Klaas van Schelven
1084796763 When not dogfooding, just print a regular stacktrace in the logs
This will hopefully help when getting issue-reports for those that
have not set up dogfooding.

See [Dogfooding Bugsink](https://www.bugsink.com/docs/dogfooding/)
2025-04-11 13:22:37 +02:00
Klaas van Schelven
0c11bf0787 Add trivial viewtest 2025-04-11 11:19:03 +02:00
Klaas van Schelven
5d01214752 Sourcemaps: a test
See #19
2025-04-11 10:32:13 +02:00
Klaas van Schelven
87130043e3 PoC of using sourcemaps in the UI
See #19
2025-04-10 15:52:34 +02:00
Klaas van Schelven
a097e25310 issue.stored_event_count: consequences for 'irrelevance'
document & assert
2025-03-31 15:25:59 +02:00
Klaas van Schelven
9b1911aded Fix issue.stored_event_count for eviction/retention 2025-03-31 14:51:58 +02:00
Klaas van Schelven
3daf3ce772 Document that interrupting SELECT in sqlite works as we expect 2025-03-31 13:16:01 +02:00
Klaas van Schelven
66b384a87d issue UI pages: optimization
no need to calculate event_qs_count (which is potentially expensive) if that's
not used in display.

when counting was moved from the template to the view (in 1eea9268a5) it was
made unconditional; here we restore that behavior.
2025-03-31 13:07:32 +02:00
Klaas van Schelven
524f5ea45e Issue Tag display: for low event-counts, show more tags
and for high event-counts, display a warning about what is hidden
2025-03-31 09:56:31 +02:00
Klaas van Schelven
5a9bab9e20 EagerPaginator
as explained in the comment
2025-03-13 14:49:49 +01:00
Klaas van Schelven
4ca564b98b Show 'stored events' in 'Issue key info' 2025-03-13 09:05:29 +01:00
Klaas van Schelven
0257884a69 Search results count: intcomma 2025-03-13 09:01:21 +01:00
Klaas van Schelven
175e103d23 Search optimization: when counting the results takes too long, don't 2025-03-12 21:26:47 +01:00
Klaas van Schelven
c3ed995ecc Performance (of non-search): don't count if you know the answer 2025-03-12 20:44:50 +01:00
Klaas van Schelven
1eea9268a5 Optimization: Search on EvenTag without involving Event if possible
When searching by tag, there is no need to join with Event; especially when
just counting results or determining first/last digest_order (for navigation).

(For the above "no need" to be actually true, digest_order was denormalized
into EventTag).

The above is implemented in `search_events_optimized`.

Further improvements:

* the bounds of `digest_order` are fetched only once; for first/last this info
  is reused.

* explicitly pass `event_qs_count` to the templates

* non-event pages used to calculate a "last event" to generate a tab with a
  correct event.id; since we simply have the "last" idiom, better use that.
  this also makes clear the "none" idiom was never needed, we remove it again.

Results:

Locally (60K event DB, 30K events on largest issue) my testbatch now
runs in 25% of time (overall).

* The effect on the AND-ing are in fact very large (13% runtime remaining)
* The event details page is not noticably improved.
2025-03-12 20:38:07 +01:00
Klaas van Schelven
cd7f3978cf Improve tag-overview performance
* denormalize IssueTag.key; this allows for key to be used in and index
  (issue, key, count).

* rewrite to grouping-first, per-key-query-second. i.e. reverts part of
  bbfee84c6a. Reasoning: I don't want to rely on "mostly unique" always
  guessing correctly, and we don't dynamically determine that yet. Which
  means that (in the single query version) if you'd have a per-event value for
  some tag, you could end up iterating over as many values as there are events,
  which won't work.

* in tags.py, do the tab-check first to avoid doing the tag-calculation twice.

* further denormalation (of key__key, of value__str) actually turns out to not
  be required for both the grouping and indivdual queries to be fast.

Performance tests, as always, against sqlite3.

--

Roads not taken/background

* This commit removes a future TODO that "A point _could_ be made for
  ['issue', '?value?' 'count']", I tried both versions of that index
  (against the group-then-query version, the only one which I trust)
  but without denormalization of key, I could not get it to be fast.

* I thought about a hybrid approach (for those keys with low counts of values
  do the single-query thing) but as it stands the extra complexity isn't worth
  it.

---
on the 1.2M events, 3 (user defined) tags / event test env this
basically lowers the time from "seconds" to "miliseconds".
2025-03-12 14:14:05 +01:00
Klaas van Schelven
b031792784 Event (tag) search: performance improvement
Done by denormalizing EventTag.issue, and adding that into an index. Targets:

* get-event-within-query (when it's 'last' or 'first')
* .count (of search query results)
* min/max (for the first/prev/next/last buttons)

(The min/max query's performance significantly improved by the addition of
the index, but was also rewritten into a simple SELECT rather than MIN/MAX).

When this code was written, I thought I had spectacularly improved performance.
I now believe this was based on an error in my measurements, but that this
still represents (mostly) an improvement, so I'll let it stand and will take
it from here in subsequent commits.
2025-03-12 14:11:43 +01:00
Klaas van Schelven
0060e86117 Fix on event-list 'n available' display 2025-03-10 09:50:49 +01:00
Klaas van Schelven
f548eab778 Merge branch 'main' into tag-search 2025-03-10 09:09:40 +01:00
Klaas van Schelven
3ee6f29f9c tags: fix the indexes
this is the part I was able to do with careful reading (and rerunning the
tests); actual performance implications will be checked based on this
2025-03-07 20:59:21 +01:00
Klaas van Schelven
af4641a43d Tags page: case for empty 2025-03-07 14:14:05 +01:00
Klaas van Schelven
dfd15570e9 Fix on event details: when there are no tags, don't display the header 2025-03-06 15:24:11 +01:00
Klaas van Schelven
39bddb14b7 handled: searchable as a tag
also: don't display this in the detail view when the value isn't actually
in the data
2025-03-06 15:19:55 +01:00
Klaas van Schelven
977aae1c25 Show remaining (in db, AKA 'available') number of events in the issue-list
prompted by a user being confused about the number of events in their DB;
not 100% sure I'll keep this info here, but I'm introducing it for now
at least
2025-03-06 13:32:32 +01:00
Klaas van Schelven
646b1ea090 Details page: be robust for top-level message-as-string
Fix #55
2025-03-06 13:09:29 +01:00
Klaas van Schelven
20a54381dc Refactor: move tags/search stuff to its own module 2025-03-06 09:26:35 +01:00
Klaas van Schelven
37fcc348c3 Preserve query when navigating from issues to events
and vice versa
2025-03-05 16:53:18 +01:00
Klaas van Schelven
f76d3f4f40 Merge branch 'main' into tag-search 2025-03-05 16:05:17 +01:00
Klaas van Schelven
381a5caae4 Issue.calculated_* fields: fix lengths
as in a717dd7374, but for Issue as well as Event.
The need for this was exposed by running the testsuite
against mysql; this commit fixes the tests.
2025-03-05 11:14:19 +01:00
Klaas van Schelven
4cde74d7cb Event search: first version 2025-03-04 13:51:56 +01:00
Klaas van Schelven
0cbdae9411 _get_events helper: clarify edge-cases
In b76e474ef1, the event-navigation was changed into the next/prev idiom (I
think completely, i.e. also from the .html files, but did not check) but the
elif structure and error message did not fully reflect that (it still talked
about digest_order/id, but nav is now one of the primary methods)

I briefly considered removing the lookup-by-digest-order-only, but I figure it
may come in handy at some point (if only for users to directly edit the url)
and did not check whether this is actually unused.
2025-03-04 09:59:03 +01:00
Klaas van Schelven
0de8261440 Restore mostly_unique filter
botched in bbfee84c6a
2025-03-03 15:58:20 +01:00
Klaas van Schelven
a00a815261 Merge branch 'main' into tag-search 2025-03-03 15:02:13 +01:00
Klaas van Schelven
70b77d71ee Fix conditional on 'Issue Tags' RHS 2025-03-03 13:42:36 +01:00
Klaas van Schelven
bbfee84c6a issue tags: single query rather than one-per-tag 2025-03-03 13:42:18 +01:00
Klaas van Schelven
e6bc660731 Add note about per-key tag pages 2025-03-03 13:25:41 +01:00
Klaas van Schelven
1ae5bb3fd1 Tags: no cutoff when there are many
this idea was superceded by doing it explicitly in 00c49443eb
2025-03-03 13:23:52 +01:00
Klaas van Schelven
5930740e0b Tags: as a separate tab 2025-03-03 12:56:20 +01:00
Klaas van Schelven
c8ecf508de Tags: on event details page show calculated tags
(not just the explicitly provided ones)
2025-03-03 11:29:07 +01:00
Klaas van Schelven
124f90b403 'Issue Tags' box: show on all issue-related pages
now that it's no longer tied to the event...
2025-03-03 11:00:11 +01:00
Klaas van Schelven
00c49443eb Add 'mostly_unique' property to tags 2025-03-03 10:52:28 +01:00
Klaas van Schelven
1571a4f87f Linebreaks in event detail values
Prompted by .message; but more generally useful and applied.

Fixes #51
2025-03-03 09:12:06 +01:00
Klaas van Schelven
60920b7299 fix 'n total observed' at top of event-list page
this was showing the project's count since 336e126e3e, i.e. since
it was introduced
2025-02-28 11:29:21 +01:00
Klaas van Schelven
7a30de3840 Issue Tags: select_related 2025-02-28 10:09:53 +01:00