Strategy for Storing Large Amount of Ordered, but Reorderable Data in Database? -


If you have a large amount of data in a specific quantity (say one million lines), then in a special order To come back, one way to do this clearly is to just put that numerical index on each line and order by that index. However, if you want to create a new line in the middle of that data, then you must either expect that there is a difference between the two rows placed between the lines, or you need to set up the table "Status = Position + 1 where position> new_position "which is potentially slow and not scalable.

Is there a clever strategy to deal with this? Do I just hope to leave the big gap between my rows (possibly the lines of space with the background process). Is there a database similar to a linked list?

Edit: I know which index and how traditional order is done (Read my first sentence.) I am thinking that to put a new line in the middle of a command structure The data structure is, therefore the boundary questions can still be done. A traditional next / previous indicator will not work in such a way as a query query, which I know.

You can not just create a tip in the middle of your data, you will add it to the end of the column order The correct sequence should be used to return the data and it will be faster on indexing.

Is there a database similar to a linked list?

Not directly - There are some ideas for storing trees inside SQL - which is a little more than asking for you - but almost the same design but be aware that they are every Tupal Results in a query for (read link link, select next tube) If you deal with millions of Tuples then it will be very slow.

Your edit: You can not add between Tuples!

If you really need to do this: <

  • Old table drop
  • Rename the new table in the old table
  • Create a new table - Add everything to the desired order
  • Older tablet drop
  • Keep in mind that you need to do this for each added tuple (unless it finishes your data Is not added)

  • Comments

    Popular posts from this blog

    c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

    Calling GetGUIThreadInfo from Outlook VBA -

    Obfuscating Python code? -