DB examples corrupted? and other questions

Monte Goulding monte at sweattechnologies.com
Sun Jul 13 03:16:00 EDT 2003


> The 10,000-record "limit" is by no means absolute, and can be greatly
> exceeded depending on how your data is stored.
>

> The trick is to put tables in simple tab-delimited text in a variable
> rather than in fields on cards.  The latter is where bulk and performance
> issues come from:  the engine needs to make a text record
> structure for each
> field on every card along with a card record structure in addition to the
> data itself.  Plus, accessing data in a field is almost always much slower
> than grabbing an item from a line in a block of text.

Hey Richard

I'm wondering if you have tested multi-dimensional arrays (stored as
customproperty sets)? I think the direct access nature would kill
tab-delimited text. What abut using something like: primaryKey,columnName as
the array key? I think it could be very fast and handle much more data. In
addition there is no risk from the delimiters.

The only issue I can see is the keys would return a very long list but this
could be parsed quickly using filter etc.

Test setup script:

on mouseUp
  repeat with x=1 to 10000
    repeat with y=1 to 50
      put random(100) & tab after tData
    end repeat
    put cr into char -1 of tData
  end repeat
  set the cTest of this stack to tData
  repeat with x=1 to 10000
    repeat with y=1 to 50
      put random(100) into tDataA[x,y]
    end repeat
  end repeat
  set the customProperties["cTest"] of this stack to tDataA
end mouseUp

Test script:

on mouseUp
  put the long seconds into tSeconds
  set the itemDel to tab
  put the cTest of this stack into tTest
  repeat with x=0 to 10000 step 100
    put item 25 of line x of tTest into tData
  end repeat
  put the long seconds - tSeconds into tTest1
  put the long seconds into tSeconds
  repeat with x=0 to 10000 step 100
  put the cTest[x,25] of this stack into tData
  end repeat
  put the long seconds - tSeconds into tTest2
  put tTest1,tTest2
end mouseUp

Result 0.219,0.002

Food for thought ;-)

Regards

Monte




More information about the use-livecode mailing list