Re: How to express a b-tree in SQL?

From: Thomas Muller <ttm_at_nextra.com>
Date: 2000/02/28
Message-ID: <8Ftu4.1697$6b1.24226_at_news1.online.no>#1/1


KenNorth <knorth_at_my-deja.com> wrote in message news:OTHp4Mmf$GA.276_at_cpmsnbbsa04...
> George,
>
> SQL DBMSs, including Oracle, use b-tree indexes for numbers and character
> data. When you run a query, you don't have to worry about manipulating the
> tree (for example when INSERTing rows). The DBMS does that for you.

Off-course. The originator wanted to model a BTree in SQL, and I just made a point that standard SQL doesn't have build-in mechanisms (recursiveness) to deal with graphs in a natural manner. The fact that the DBMS utilize b-tree indexes internally does not affect this fact in any manner. Btrees just happens to be a more adequate structure than other structures because the indexes are stored on file, and having the pagesizes equal to the storage device's pagesize significally improves the index-retrieval performance. Any map-implementation, though, would offer the same _functionality_.

>
> Given that, you can still model a tree structure in SQL. Check out SQL FOR
> SMARTIES by Joe Celko (Morgan Kaufmann Publishers).
>

Standard SQL is not functionally complete, hence at some point you have to meet the wall when it comes to expressiveness. I never said it was impossible to model tree-structures in SQL, merely stressed the fact that it is harder compared to functionally complete languages.

--

Thomas
Received on Mon Feb 28 2000 - 00:00:00 CET

Original text of this message