On Sat, Feb 28, 2004 at 08:37:44PM +0100, Ivo Köthnig wrote:
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.
For sorted lists (index) you will need heaps. Sorting for the largest articles is one example. I think MySQL would use heaps (or hash-tables) for such thinks...
No, it wouldn't use heaps. MySQL would use B+tree index. It would, if the indexes were set up right. As they aren't, it has to go through entire database (including cur_text) to find largest articles, project it so it contains only sizes, then use generalized merge sort to find the largest articles.