• 1 Post
  • 16 Comments
Joined 11 months ago
cake
Cake day: May 28th, 2024

help-circle
rss

  • When it comes to searching the database, the index will have already been created. When you create an index, it might take a while as the database engine reads all the data and creates a structure to shadow it. Each engine is probably different and I don’t know if any work exactly like that, but it’s an intuitive way to understand the basics of how B-trees work. You don’t really need to think much about how it works, just that if you want to use a column as a filter, you want to index it.

    However, when you’re thinking about the structure of a database it’s a good idea to think what you’ll want to do with it before hand and how you’ll structure queries. Sometimes searching columns without an index is unavoidable and then you’ve got to come up with other tricks to speed up your search. Like your doctor might find you (i’m presuming gaz is sort for gary and/or gareth here) with a query like SELECT * FROM patients WHERE birthdate = "01-01-1980" AND firstname LIKE "gar%" The db engine will first filter by birthdate which will massively reduce the amount of times it has to do the more intensive LIKE operation.



  • If there’s something you want to search by in a database, you should index it.

    Indexing will create an ordered data structure that will allow much faster queries. If you were looking for the username gazter in an unindexed column, it would have to check literally every username entry. In a table of 1000000 entries it would check 1000000 times.

    In an indexed column it might do something like ask to be pointed to every name beginning with “g”, then of those ask to be pointed to every name with the second letter “a” and so on. It would find out where in the database gazter is by checking only six times.

    Substring matching is much more computationally difficult as it has to pull out each potentially matching value and run it through a function that checks if gazter exists somewhere in that value. Basically if you find yourself doing it you need to come up with a better plan.

    Cartesian explosion would be when your query ends up doing a shit load of redundant work. Like if the query to load this thread were to look up all the posters here, get all their posts, get the threads from those posts and filter on the thread id.









  • On the one hand, it’s bait.

    On the other hand I don’t think the country that has formalised slavery and a culture of policing which views it’s own citizens as prey really has the right to dictate conversation on race relations.

    In no other field would such failure be seen as authority. You wouldn’t pick a garage to fix your car because them accidentally destroying the most engines shows they’re experts.




  • Lol.

    Seven years ago I spent hours trying to explain to my MP that this would happen if they weakened encryption and put in back doors.

    He seemingly couldn’t get his head round the fact that you have to assume foreign adversaries have access to everything in transit and they’re not going to be worried about longer prison sentences designed to make up for weaker security.

    I should send him an email asking if he understands the argument now it’s coming from an American in a suit and not just one of the plebs.


  • The fundamental problem with cryptocurrencies is that the people with the enthusiasm to make them (libertarians), are too stupid (libertarian) to understand why a deflationary asset cannot work as a currency.

    It’s inherently a speculative investment. Nobody is going to spend something that might be worth dramatically more tomorrow and nobody is going work for something that might be worth dramatically less tomorrow.