Unfortunately, my question in the lobby didn't snag the attention of the DB expert that is a mod and RO there, so I'll try one more shot here as I'm actively tearing my system apart once again for this and I hope I get the foundations right this time :)
Opinion poll time: I have a DB table tracking orders and their status codes (let's say there could be 10 different status codes). Some of those codes could be considered "complete". Do I have a single table tracking orders and have an "is_complete" Bool column that is indexed, or do I move those orders out of the main table into a different "historical" orders table?
My feeling is that it should be a single table since my "is_complete" criteria could change at any time if I add more status codes, but that's not how I've seen it set up in other places in the past. Now I'm confused about why they decided to move "complete" orders out of the main table. Perhaps indexing on a bool column isn't very efficient so it's better just to not have them in a table scan at all?
The backend solver only cares about anything "is_complete = False". The frontend will always want an uninterrupted history of all orders
I can see stuff like this that says cardinality is shot on indexing a bool value but, at the same time, it's a massive differentiator in a search tree; it'd be the biggest predicate condition I could imagine
I'm wondering whether I'm conflating two different things. Perhaps it is better to keep it all in a single table, but just get rid of the actual index on the bool state
So, an archive, basically. I think you've helped me to a solution - keep the last 12 months in the active table and then just push to archive. It makes a neat delineation where I don't have to bother with JOIN etc. in every query
Around here we track meta data of compute tasks for monthly aggregates. So the current month stuff is always needed and in the DB. But older stuff might still be needed for recalculations or reprocessing; so we have 2-3 months worth of data in the DB in case someone down the line finds an error in reports. Everything older is unlikely to be needed, so it gets dumped to archive files regularly.
@roganjosh I have reclaimed the conjecscore throne! When/if you get less busy with work, i've got a lot of cool ideas about conway's 99 conjecture. I also have another open conjecture that can be gamified I think.
When I'm less busy with work... aha. ahahaha. ahahahaha. I've literally staked everything I've got against my project now; I have a meeting with the accountant tomorrow to keep me afloat for the next year. I'm sink or swim at this point, mate :) I'm still curious about your new approach, though. I think you have 2 githubs and I only had a link to one?
@roganjosh
Oh I haven't pushed to github yet. The idea is that if you only flip one edge, you don't have to check the score of every pair of vertices. The loop goes down from 4851 iterations to 99.
Sorry to hear about work. I hope it gets better soon!
I don't think I'll get another opportunity to do something like it again. Because I was a contractor, most of my money is actually in a business account. I can release some as a divident to keep me going for at least a year, but that's cash burn so I better be making money before that dries up!
also, i might be able to incorporate some stuff from this question: math.stackexchange.com/q/5108418/15140 to make the conway program even better, but I have yet to do so...
i have code in place for another open problem called Magic Square of Squares too. I just need to do some database migrations but idk what I'm doing with database migrations lol.