Am Samstag, 28. Februar 2004 20:47 schrieb Tomasz Wegrzanowski:
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.
I think a B+tree is nothing else than a special heap...
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.
Yes, so we should have an index for that. It should be fastet to have an
O(logn)-Operation more for each edit instead of a O(n*logn)-Search each time
a user want the largest articles... (n = Number of articles)
--Ivo Köthnig