-trees attribtypetablereclength int(indexfile readline()attribtypeindex eval(indexfile readline()elseattribtypeindex btree( attribtable open("feedattribtype tbl"," "offset for record in attribtablefeedattribtypeid readfield(record,attribtypecols, anitem item(feedattribtypeid,offsetattribtypeindex insert(anitemoffset+= attribtypetablereclength len(record print("attrib type table index created"indexfile open("feedattribtype idx"," "indexfile write(str(attribtypetablereclength)+"\ "indexfile write(repr(attribtypeindex)+"\ "indexfile close( feedtable open("feed tbl","rb"feedattribtypetable open("feedattribtype tbl""rb"before datetime datetime now(for record in feedattributetable feedid readfield(record,feedattributecols, feedattribtypeid readfield(record,feedattributecols, value readfield(record,feedattributecols, lookupitem item(feedid,noneitem feedindex retrieve(lookupitemoffset item getvalue(feedrecord readrecord(feedtable,offset,feedtablereclengthfeednum readfield(feedrecord,feedcols, feedname readfield(feedrecord,feedcols, lookupitem item(feedattribtypeid,noneitem attribtypeindex retrieve(lookupitemoffset item getvalue(feedattribtyperecord readrecord(feedattribtypetable,offset,attribtypetablereclengthfeedattribtypename readfield(feedattribtyperecord,attribtypecols, print(feednum,feedname,feedattribtypename,valueafter datetime datetime now(deltat after before milliseconds deltat total_seconds( print("time for the query with indexing was",milliseconds,"milliseconds "clearly we need the functionality of -tree to make queries possible and efficient in relational database joins the next section goes on to explain the organization of -treethe advantages of -treesand how they are implemented -tree organization -tree is balanced tree each node in -tree consists of alternating pointers and items as shown in fig -trees consist of nodes each node in -tree contains pointers to other nodes and items in an alternating sequence the items in node are arranged sequentially in order of their keys in fig the key is the first value in each tuple pointer to the left of an item points to another -tree node this copy belongs to 'acha