Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

drop unused table event_labels #13049

Open
richvdh opened this issue Jun 14, 2022 · 4 comments
Open

drop unused table event_labels #13049

richvdh opened this issue Jun 14, 2022 · 4 comments
Labels
A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. Z-Cleanup Things we want to get rid of, but aren't actively causing pain

Comments

@richvdh
Copy link
Member

richvdh commented Jun 14, 2022

We seem to have a table called event_labels which is wholly unused

@clokep
Copy link
Member

clokep commented Jun 14, 2022

We filter on it at:

if event_filter and event_filter.labels:
# If we're not filtering on a label, then joining on event_labels will
# return as many row for a single event as the number of labels it has. To
# avoid this, only join if we're filtering on at least one label.
join_clause += """
LEFT JOIN event_labels
USING (event_id, room_id, topological_ordering)
"""
if len(event_filter.labels) > 1:
# Multiple labels could cause the same event to appear multiple times.
needs_distinct = True

And we insert into it at:

# Store the labels for this event.
labels = event.content.get(EventContentFields.LABELS)
if labels:
self.insert_labels_for_event_txn(
txn, event.event_id, labels, event.room_id, event.depth
)

Note that this is from MSC2326 (but not behind an experimental flag, since it has been there a long time).

@squahtx
Copy link
Contributor

squahtx commented Jun 14, 2022

In #1207 @H-Shay, notes that it comes from an implementation of MSC2326. Which I believe has been completely superseded by threading?

I'm in favour of removing it all.

@richvdh
Copy link
Member Author

richvdh commented Jun 14, 2022

oh, hrm. I assumed it was unused because it's empty on matrix.org. I'm inclined to rip it out rather than leave essentially-unused code sitting around.

@clokep
Copy link
Member

clokep commented Jun 14, 2022

Which I believe has been completely superseded by threading?

I don't really think it has been superseded by threading, but there is an overlap. 🤷 (That conversation likely belongs on the MSC though!)

@erikjohnston erikjohnston added the T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. label Jun 15, 2022
@MadLittleMods MadLittleMods added A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db Z-Cleanup Things we want to get rid of, but aren't actively causing pain labels Apr 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Database DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. Z-Cleanup Things we want to get rid of, but aren't actively causing pain
Projects
None yet
Development

No branches or pull requests

5 participants