database design - Display Order in DB -


what's best way track display order in database? have been using integers (1 being displayed first , 5 last) worry corrupting data somehow.

is there better way?

for simple display purposes use simple integer increments of 10 if number manipulated manually. leaves room few adjustments. or if number maintained code, go increments of 1.

when model more "important" or busineslike, consider adjacency list model.

performance , scalability may of concern here, because if use number in list of 10,000 items, may have lock/update 10,000 rows. of course, use larger increments , peeky & sneaky @ cost of more complexity.
adjacency list not have problem, more difficult query on other hand.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -