Re: Best lib for large tables?
Re: Best lib for large tables?
- Subject: Re: Best lib for large tables?
- From: has <email@hidden>
- Date: Mon, 29 Apr 2002 19:57:03 +0100
Joakim Jardenberg wrote:
>
I need to manage a large set of data, and easily do lookups and
>
modifications to the data.
>
What I have found is that an simple "in memory" flat database is what I
>
need and I have looked at to libs/mods that seems to be able to do it. I
>
would like som advice.
>
>
My data will concist of around 5000-1000 "rows" each of them with the
>
following "fields"
>
"5 char string (numeric - but must be treated as string)", "4 char
>
alphanumering string", "2 char alphanumeric string", "empty or 2-4 char
>
string", "empty or 3-5 char integer", "empty or 2-4 char string".
>
Something like
Values lengths are not an issue with something like stringLib (you'd more
likely encounter these with a file-based data store, where fixed-lengths
are often required for performance reasons).
On the down side, tableLib doesn't support null/empty values for
integer/real/boolean-class fields. (For string fields you just use "".) I'm
sure this is something I could add to a future release, but I'd have to
decide how empty values should be treated during filters and sorts first -
suggestions are obviously welcome. If your values are always positive, I
guess you could always use -1 as your null value.
>
{"10001", "F1I2", "A2", "", 100, ""}
>
{"10022", "E1O6", "A2", "",, "BB"}
>
>
In some cases, when I work my way down my data I may encounter an entry
>
that is:
>
{"10001", "F1I2", "A3", "", 200, ""}
>
and in that case the new entry shall not be added, but instead the
>
existing row shall be updated to read
>
{"10001", "F1I2", "A3", "", 300, ""}
>
>
etc...
>
>
I have looked at tableLib (has) and TableSearchServices (Victor Yee) and
>
they both look excellent and able to fullfill my needs. But is one
>
faster then the other when it comes to this amount of data?
Absolutely no idea. The two libraries have very different interfaces,
feature sets and internal implementation. I suspect you'll have to do your
own tests to find out (btw, I'd be interested to know the results myself).
A couple of considerations:
- TableSearchServices [iirc] takes a list of lists and works on them as-is.
tableLib creates custom objects - you can import/export existing
list-of-lists or text-based tables. If you're doing lots of other things
with your list-of-lists, you're going to find TableSearchServices more
efficient than constantly importing & exporting from tableLib.
- The wildly different implementations might mean that one library may be
faster than the other for certain operations but slower on others. Compare
on several different types of operations, and pick the one that's fastest
on the operations you'll perform most often.
I hope to add indexed field support to tableLib eventually; this should
significantly improve performance when filtering and/or sorting on indexed
fields. [But don't hold your breath; it's some way down my priority list at
the moment and will require a fair amount of work to implement.]
BTW, I'm not sure if Victor's reading the list at the moment or not (I
remember him saying he might take a short break), so you might want to mail
him direct with any queries.
>
I will be
>
doing tons of lookups in existing tables as I add to them from my lists.
>
>
Or is there another, even better alternative?
AS is relatively poor when it comes to libraries. Other scripting languages
will give you full-blown SQL-style databases, but since AS has such good
[scriptable] application integration there's never been quite the same
motivation.
I know Jeff Baumann does work with file-based data stores; I'm not sure if
he's made that code publically available, but you might want to chat with
him as well. Akua Sweets contains a number of functions for working with
lists, and lists of lists. Can't think of anything else offhand, other than
the obvious: "If all else fails, there's always FileMaker Pro...:)"
HTH
has
--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.