Follow

I don't think I will ever understand why some SQL things take as long as they do

it turns out that my table of ~50 million rows had no index. So that may be part of it.

@inmysocks are you using any joins? Joining in the "wrong" order or using the "wrong" keys can result in multiplying two tables - which is not good if one of them has 50M rows.

@zatnosk no, it is a pretty straight forward select:

SELECT offset, node, run, time, hears, transmitting, received FROM data WHERE run=400

and run is now an index.

It is workable, about 5 seconds per query and it returns ~200k rows.
I was just expecting it to be faster. I don't know if that was an unreasonable expectation at the start.

@inmysocks 5 seconds seems high, but I'm also not used to work with picking 200k out of 50m rows.

Sign in to participate in the conversation
Awoo Space

Awoo.space is a Mastodon instance where members can rely on a team of moderators to help resolve conflict, and limits federation with other instances using a specific access list to minimize abuse.

While mature content is allowed here, we strongly believe in being able to choose to engage with content on your own terms, so please make sure to put mature and potentially sensitive content behind the CW feature with enough description that people know what it's about.

Before signing up, please read our community guidelines. While it's a very broad swath of topics it covers, please do your best! We believe that as long as you're putting forth genuine effort to limit harm you might cause – even if you haven't read the document – you'll be okay!