Ivo Köthnig wrote/schrieb/a écrit/skribis/etc.:
Am Samstag, 28. Februar 2004 04:22 schrieb Timwi:
You have not provided examples of "overhead calculations" that a DB would have to perform that a file system wouldn't. You also haven't provided evidence of your claim that DBMSs cannot represent the required range of data structures.
That starts with parsing and transforming a sql-statement into an expression of relational algebra (which can not always produce the optimal (fastets) expression) and ends by the point that you are restricted to these expressions which can be handeled only step by step (operation always on the huge table).
I think you are greatly underestimating the powerful optimisations that can be done (and are done) in MySQL. Parsing an SQL statement is trivial (in terms of required computational power); I don't know much about relational algebra, but it seems that you would somehow have to express and then parse statements in that algebra too. If you don't have an index, then operations on huge tables are slow no matter what data structure you use. Any kind of indexing alleviates this problem, and RDMBSs do indexing really well.
There is a huge number of organisatorial tasks that you would need to do with your files (when reading, that would be parsing the file, locating data, possibly caching and perhaps sorting; when writing, that would be updating indexes, managing "holes" in the file, and a huge host of other
that is no problem if you use good datastructures...
I think you haven't quite understood what I was getting at here. This is independent of what data structure you use.
DBMSs are specifically designed to do exactly these things. People often tend to forget that DBMSs aren't really much more than systems that manage files! But they have all these incredibly complicated and advanced things in it that you need and you really really don't want to have to re-implement from scratch.
Yes, but you don't want to implement each of that features.
Yes, you do. You do need to manage your files. You do need to store your data structures somehow, and parse them, and update them, etc.etc.
For 99.9% of data you want to store, you *can* create *exactly* the data structure you need using an RDBMS.
By data structure I am not only mean the structure of data. I also mean the code which belongs to it to handle it (For example heaps, sorted lists and so on). The structure for the data surly can be created but not the code...
You never specifically need [[heap]]s. A heap is a special way of implementing a [[priority queue]] - if you need a priority queue, then you can do that by creating an indexed table. Whether the index is implemented as a heap should not be your concern (it should be the DMBS's). It is well possible that MySQL uses heaps, I don't know.
Timwi