Making Revolution faster with really big arrays
Brian Yennie
briany at qldlearning.com
Wed Apr 13 19:20:15 EDT 2005
> Brian,
>
> Can you create a 10000 by 2500 by 100 array of random numbers
> (sparsely populated i.e. some values are null) in SQL?
Sure. There would be a few ways to do it, but for instance:
INSERT INTO someTable10000 (someValue10000) VALUES ( (1), (3), (46),
(23), (12), (NULL), (8), (NULL), ...);
INSERT INTO someTable2500 (someValue2500) VALUES ( (2), (4), (NULL),
(NULL), (2), (NULL), (98), (NULL), ...);
INSERT INTO someTable100 (someValue100) VALUES ( (11), (31), (426),
(2.3), (1.22), (NULL), (NULL), (NULL), ...);
> Can you put the sum of two random accessed numbers (except if one is
> null then the sum is null) into a third random location?
SELECT IFNULL(someValue10000, NULL, IFNULL(someValue2500, NULL,
(someValue10000 + someValue2500)))
FROM someTable10000, someTable2500
ORDER BY RAND(25000000);
> How fast can you do this last thing 25000000 times in SQL.
> This is the simplest of the things I am doing.
> If you can do that in SQL in less than a minute, you've got my
> attention :-)
Would have to try it, but I'd say you've got a shot.
Your scripting ideas have merit also, this one just felt like database
to me...
-Brian
More information about the use-livecode
mailing list