Filtering array vs plain list

Peter Alcibiades palcibiades-first at yahoo.co.uk
Sun Feb 3 03:11:26 EST 2008


Len Morgan wrote

> Why are you writing off using a database?  I think you would find that
> for the amount of data you have and the way it's organized, it's going
> to be MUCH faster than anything you can do with arrays and scripts.
>
> For example to select all the Red Sox fans born in 1960 you would write:
>
> SELECT * FROM people WHERE baseballteam='Red Sox' AND birthyear='1960'
>
> To use your example of changing the baseball team:
>
> UPDATE people SET baseballteam='White Sox' WHERE baseballteam='Red Sox'
> AND birthyear='1960'


And the scales fell from his eyes and Lo, he could see!  Thanks.

What the database actually is giving you is a much more powerful filter 
command.  Filter is great but it doesn't do columns.  Its great but doesn't 
do real regex, only wildcards.  Yes indeed, why reinvent the wheel, just 
figure out the database commands.  If it were awk it might be different, 
where in effect you have a sort of built-in implicit filter with column 
addressing.  But in Rev sqlite has to be the way to go.  

I sort of half knew this from using filter and switch to get reports done, 
which does work, but it runs to several pages to do quite simple things, but 
hadn't got it explicitly till reading this comment.

Peter



More information about the Use-livecode mailing list