which one is faster marking cards or custom prop + lineoffset?
Jim Ault
JimAultWins at yahoo.com
Sun Jul 1 13:12:09 EDT 2007
In my very limited experience, the key question is what kind of searching do
you want? Simple partial word match with correct spelling, or compound
words that continually narrow the search
(and even booleans such as FIND('Tom' or 'Thomas') and FIND('Jackie' or
'Jacquie' or 'Jaci' or 'Jacqi')
Allowing the user to put in one word, see the result list, then add words to
shorten the list seems to be faster if you are working with the short list
rather than managing the marked cards.
I guess you need to decide how often there will be multiple hits and how
will the user know when there is more than one.
Jim Ault
Las Vegas
On 7/1/07 9:43 AM, "Andre Garzia" <andre at andregarzia.com> wrote:
> Friends,
> I have a questions, I have a database made with cards, each card is a
> record. To query this database, I use the following procedure:
>
> I have a custom property with a cache of the fields I'd like to query, for
> example in a phone book, I have a custom prop named "name" that holds names
> and card long ids pairs. To search, I'd use lineoffset to find the name in
> the custom prop, get the long id and jump to the card. This works very very
> fast! :-D
>
> The downside is that I need to think in advance and pre-cache everything
> every time the stack changes, which for my db is not an issue because it
> doesn't change much.
>
> Now that I know about the mark cards command, I wonder if this is fast. I
> could use it or I could make a combination of both, like if there's a cache
> for that query, then use it, if there ain't no cache, use mark cards to
> search.
>
> The database change very little, so if I can move computation from query
> time to edit time, it's an advantage to me. Anyone want to say a word or
> two?
>
> For example in a 3k cards database, looping the cards looking for a record
> took 802 millisecs. To use a custom prop cache and the filter command, it
> took 11 millisecs to find the same results. I didn't tried the mark cards
> command yet.
More information about the use-livecode
mailing list