Open JustusAdam opened 5 years ago
I'm currently away at SOSP, so can't dig too much into this at the moment, but that error was added a while ago when we realized that having two partial indexes that share some number of columns can lead to some weird upquery behavior. I can't immediately remember why though. In theory multiple indexes should be entirely independent, and shoudn't interact. It might be that there's some code that looks for any index that contains a column, rather than an index what consists only of the lookup column. You could try to comment that check out and see if things still fail in weird ways?
Okay. That's definitely something I can try. I have a test suite set up to check the results, so that should be good.
So I am trying to run this query (follows at the end), which I split into multiple subviews to circumvent some of the current quirks of the SQL noria supports.
Its rather long, I apologize, but because I don't really understand what the error is trying to tell me I am unable to reduce the example.
The actual failure occurs in
noria-server/src/controller/migrate/materialization/mod.rs:606:41
and readsThe part of the query affected is the aggregation node produced by the
count(*)
inpageview_counts
.And here is the query graph, as dumped by the system: fail.dot.pdf
I previously had the error that it could not find a bogokey to aggregate the
count(*)
over. I then changedpageview_counts1
to alsoSELECT
ts2
, which I believe is what it is now using for thecount(*)
.It may also be that the conflict is between the
GROUP BY
, which is overuser_id
ts1and the actual key used for result lookups which is just
user_id`.Let me know if you have any idea how to fix this or what I could be using as a workaround.