Re: How an index actually works

From: Andy 2014373763 <andy_at_ua.pmmci.com>
Date: Fri, 20 Jun 2003 16:23:39 +0300
Message-ID: <bcv222$2tpu$1_at_news.dg.net.ua>


Chris wrote:

> I've got a good understanding of how to use a RDBMS and SQL syntax,
> but what I (and probably most DB users) don't understand is what the
> DB engine is actually doing under the hood. Tables themselves are
> fairly simple to understand (I thin) but what I'm not so sure on are
> indexes.
>
> For example let's assume I have a table of People with FirstName,
> LastName and Age. Lets assume all fixed-length fields and view this
> somewhat like a spreadsheet. On a basic level, if I insert a record,
> it simply gets added as a row at the end of the table.
>
> However, let's say I have an idex based on LastName. After I insert
> into the table, how does the index row get inserted? Does the index
> have "holes" in it to be filled with inserts?

Index is a binary tree. After every INSERT/UPDATE, the tree is rebuilt.

-- 
Andy
Received on Fri Jun 20 2003 - 15:23:39 CEST

Original text of this message