AW: Sql nested set from dictionary
Adrian Vintu <adrianvintu-/[email protected]>
| Newsgroups | gmane.comp.windows.off-topic |
|---|---|
| Message-ID | <[email protected]> |
The nested set is pretty damn fast(tested already). It's doing SELECT BETWEEN id1 and id2 and that is fantastic. I will just get the idX of the root "word"(fast) and then SELECT BETWEEN idX_left and idX_ight. The table will look like: id word left right 100 abc 90 150 ________________________________ Von: Adwait Ullal <[email protected]> An: [email protected] Gesendet: Mittwoch, den 16. Juni 2010, 19:59:43 Uhr Betreff: Re: [OT] Sql nested set from dictionary Adrian, Even if you create the tree structure as the article suggests, it still does not address the SELECT "word%" issue, does it? - Adwait -- Adwait Ullal w: http://www.adwait. com p: (408) 898-2581 On Wed, Jun 16, 2010 at 8:50 AM, Adrian Vintu <adrianvintu@ yahoo.com> wrote: >Hi Ryan, > >Thank you for the tip. I wish however to resolve this as quick as possible - and without any hassle. > >I have already started mashing some code together and hopefully I'll get this done myself. > >Thank you, >BR, >Adrian > >PS Thing is, I have 2 databases that will use this feature. One sqlite on a mobile device and an mssql from a web service. So I would need some common code and database structure. > > > > > > ________________________________ Von: Ryan Heath <ryan.Q.heath@ gmail.com> >An: win_tech_off_ topic@yahoogroup s.com >Gesendet: Mittwoch, den 16. Juni 2010, 17:23:01 Uhr >Betreff: Re: [OT] Sql nested set from dictionary > > >Hi, > > >Maybe a Lucene index is more appropriate for your problem? > > >We have recently moved from sqlserver fultext search to a lucene index and we will never look back ;) > > >http://lucene. apache.org/ lucene.net/ > > >// Ryan > > >On Wed, Jun 16, 2010 at 2:53 PM, Adrian Vintu <adrianvintu@ yahoo.com> wrote: > > >>Hi all, >> >>I have a read-only dictionary of ~2 million words. >> >>They are now stored in an Sqlite database like this >> >>Table WORD >>ID WORD POINTER_TO_DATA >> >>1 bla 207 >>2 next 135 >>3 example 1234 >>4 other 3457 >>... >> >>Using this non-tree way of storing the words kills my system when doing a SELECT LIKE 'word%' - think mobile. >> >>I would need a script(SQL, Java, C#, Python, etc) to create a tree out of the structure, or even better, a nested set like here http://dev.mysql. com/tech- resources/ articles/ hierarchical- data.html >> >>Any help would be greatly appreciated. >> >>(I have googled around, but I am not even sure what the keywords are...) >> >>Thank you, >>Best regards, >>Adrian Vintu >> >> >