2 ms·
> But the query takes almost a second I don't think the existence of a join is sufficient to slowness like this > and when the DB is always worried about cons
by nerfhammer 16y ago
> But the query takes almost a second
I don't think the existence of a join is sufficient to slowness like this
> and when the DB is always worried about consistency and stuff so writes are kind of slow too.
Has nothing to do with relational data per se. Unless you're using foreign keys and calling that a join (which is actually fair). NoSQL stores typically do lots of work to ensure consistency and many support multi-statement transactions on top of this. Unless we're talking about only keeping data in memory but you can make a relational db do that.
> If you need some related data, you make another query based on the key stored in the first piece of data. Each query takes a fraction of a second, together they don't take as long as the full join query
That is exactly how a join is executed under the hood. Loop over rows in one table, look up a value in another table. However, the db won't force you to join based on a key. If all you're doing is looking up unique keys there's no way multiple calls will be faster unless all the data won't fit on one machine.