Re: Robert...EDS - questions/comments

new topic     » goto parent     » topic index » view thread      » older message » newer message

--- Jonas  Temple <jktemple at yhti.net> wrote:

> 1. Say I have a table with a key structure of : {atom, atom}.  I insert 
> 3 records with the following key values:  {1 , 1} {1, 2} {1, 3}.  I add 
> another 10,00 entries with other key values.  I then add {1, 4} {1, 5}.  
> Now I want to get all records with the first key value of 1.  Assuming I 
> use db_find_key and find and read the first three records, would I have 
> to read through the next 10,000 to get the last two records?  If I 
> checked for the first key value to change and then drop out of my read 
> loop I would think I would miss the last two records for key value of 1. 
>  Is this right?

No.  The records are automatically 'sorted' by key with regards to record
numbers.

Another way to do this would be to use indices with your db.  I have some plans
to do just that with my EuSQL package, which should make [some] queries very
fast.  Right now I'm getting insert/update queries to work with literal values
and parameters.  Probably indices will be the next thing I tackle (don't hold
your breath, though :).

Currently, EuSQL would search through all records looking for keys starting
with '1', although the syntax for doing so would be easy, assuming you've
defined the key as a couple of fields "select * from tablename where key.field1
= 1". (Actually, you can't use '*' in the version currently at RDS, but I
should probably have an update by the end of the week which will allow delete,
insert, update and parameterized queries.)

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu