Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Mumps > Re: Retrieve an...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 11 Topic 894 of 990
Post > Topic >>

Re: Retrieve an array using non-subscript data

by John Murray <johnm@[EMAIL PROTECTED] > Oct 3, 2007 at 03:47 PM

> Do you mean that creating indices like you put it (with an 
> 'X' suffix at the end of your globals names) is a convention 
> when using M[umps] ?
....
> 
> Is this *really* the way to go ? Is this how it works with M[umps] ??

Globals are only implicitly indexed by their subscripts (there can be
multiple levels, though in your case there is only one).

If you want to lookup/traverse your records using some other key it's
efficient to have additional indices. M[UMPS] doesn't maintain them for
you, because it has no knowledge of the semantics of the data you're
storing at a global node. It doesn't know that piece 2 is significant.
It doesn't even know that there *are* pieces; it's just your convention
that ` is a separator of pieces of data.

An index helps you find relevant records fast. Instead of searching your
zillion records for those with a certain value of piece 2, index piece-2
values whenever you file them. It doesn't have to be a big overhead to
do this.

Of course, if you already have a zillion reecords and then decide you'd
like an index on piece 4, you have to do two things:

1. Extend your filing and deleting code so index #4 is maintained.

2. Walk the zillion records, creating an index #4 entry for each one.

Step 2 might take a while, but you only have to do it once.

As Bhaskar says, M[UMPS] is not a DBMS in its own right.

John
 




 11 Posts in Topic:
Retrieve an array using non-subscript data
=?iso-8859-1?q?S=E9bastie  2007-10-03 00:31:34 
RE: Retrieve an array using non-subscript data
John Murray <johnm@[EM  2007-10-03 09:12:50 
Re: Retrieve an array using non-subscript data
=?iso-8859-1?q?S=E9bastie  2007-10-03 04:47:24 
Re: Retrieve an array using non-subscript data
Rob Tweed <rtweed@[EMA  2007-10-03 15:40:39 
Re: Retrieve an array using non-subscript data
John Murray <johnm@[EM  2007-10-03 15:47:19 
Re: Retrieve an array using non-subscript data
=?iso-8859-1?q?S=E9bastie  2007-10-03 23:53:59 
Re: Retrieve an array using non-subscript data
"K.S. Bhaskar"   2007-10-04 07:10:13 
Re: Retrieve an array using non-subscript data
"K.S. Bhaskar"   2007-10-03 07:04:00 
Re: Retrieve an array using non-subscript data
=?iso-8859-1?q?S=E9bastie  2007-10-03 08:30:46 
Re: Retrieve an array using non-subscript data
Pete <peter.charbonnie  2007-10-03 17:35:28 
Re: Retrieve an array using non-subscript data
lmv <lverhulst@[EMAIL   2007-10-04 09:06:45 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 20 0:21:51 CDT 2008.