July 3, 2007 at 11:41 pm
I want to select abt 27k rows from a table of 100k rows and sort the selection in a tree format in the least amount of time . what should i do ?
this database keeps growing at faster rate.
July 4, 2007 at 12:49 am
See "expanding hierarchies" in books online. There's lot's of other methods but that one is pretty easy.
For wicked speed, try the following URL with the understanding that it takes a bit to learn the technique and setup... I believe there's a bug in a couple of the pieces of code, but the principle is absolutely sound. Doesn't take much to fix the code.
http://www.ibase.ru/devinfo/DBMSTrees/sqltrees.html
--Jeff Moden
Change is inevitable... Change for the better is not.
July 4, 2007 at 3:03 am
Hi! Thank you. That was really helpfull.
is there any technique to make this work faster.presently it takes around 12 minutes for selecting and arranging the data in trees.( selecting 27k rows from 100k rows). can u help me on that area.
Jibi
July 4, 2007 at 11:40 am
If you're talking about the method in the URL I provided and not the BOL solution, some indexes will certainly help once the tree for the whole DB is constructed. It'll do a 27k hierarchical lookup in almost no time (literally). But, you have to build the tree for the whole DB...
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply