Skip to content

Conversation

@ssteffen
Copy link
Collaborator

…to be used by leveraging where clauses on joins and aliasing.

…to be used by leveraging where clauses on joins and aliasing.
@ssteffen ssteffen self-assigned this Apr 14, 2025
@etisonMachineUser etisonMachineUser added the enhancement New feature or request label Apr 14, 2025
@ssteffen ssteffen closed this May 2, 2025
@ssteffen ssteffen reopened this May 2, 2025
@ssteffen
Copy link
Collaborator Author

ssteffen commented May 2, 2025

While I’ve got something relatively close the more I review it the more nervous it makes me because of the following reasons:

  1. In order to support aliasing which was necessary to be able to do two joins - we could not rely on ActiveRecord behavior and had to construct the joins manually. This introduces the issue of us basically re-implementing basic AR behavior which I don’t feel is the right long-term move for a rails-based gem.
  2. The blast radius on the above is an exponential increase over the other behavior we’ve been able to support. I thought it would be a smaller blast radius before but as it’s come together the complexity kept snowballing
  3. Even when we get this working and robust - it really only makes the case of “Contacts tags is one of (x,y) AND Contacts tags = z” work correctly with a flat joins. But based on a lot of the metrics in newrelic most of the nasty queries are using ORs and NOT INS anyway, which is not in scope for flat_query anyway due to how complex those queries are going to get. I’ve been discussing with members of the team some alternative options for this that we might explore. More on this later.

For these reasons, I'm going to leave this draft PR up as a place to come back to in the future, but we will not be moving forward with this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants