Optimising LIMITs - alter table order by...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Pavel,

Tuesday, March 2, 2004, 7:20:03 AM, you wrote:

PL> 2. ALTER TABLE `board` ORDER BY `threadid` DESC;

I never knew you could do this - it's quite fascinating this list
sometimes :)

I do have a question though - if I use this "order by" table
alteration, does MySQL remember it, or will I need to keep doing it
every now and again?

For example if I view the data in my table I can see the IDs like
this:

1
2
3
250
5
6
323

(etc)

This is simply where MySQL has gone back and re-used an old slot for a
new record.

However if I use your query technique for bringing back a block of
records knowing they're in the exact right sequence - will MySQL just
fragment this again over time?

PL> Split your table in two tables, like:

I can't see a real benefit of doing this. In my mind 675 bytes per
thread isn't really that much. The only thing I could split away would
be the subject of the thread (associated messages are held elsewhere)
but in making a smaller table I'd just have to join the data back in
again, surely?

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux