[Q] changing keySize:

Norberto Manzanos nmanzanos at gmail.com
Fri Apr 21 19:25:12 UTC 2006


I'm very sorry. I was confused. The problem was not the keySize at all.
Evidently, when I thought I was adding objects, sometimes I wasn't, so
it was faster and I believed something was wrong when actually it was
ok.
Thas the code

MagmaRepositoryController
    create: Pathname default,'magma\CaicytDB.magma'
    root: Dictionary new.

magmaSession:= (MagmaSession openLocal:Pathname default,'magma\CaicytDB.magma').
magmaSession connectAs: 'nor'.

mCollection:= magmaSession commit: [ magmaSession root at: 'Country'
put: MagmaCollection new ].
mCollection addIndex: ((MaSearchStringIndex attribute: #stringName)
keySize: 128).

"thats my collection of countries, in a sort of pseudo db"
Time millisecondsToRun:[
  (1 to: 10)  do:[:idx |  magmaSession commit: [ (magmaSession root
at: 'Country') add: (countries at: idx) object]]].
No matter what is the size of the index, the time to add ten objects
is about one minut.
Even without index, the time is almost the same.
So the problem is not the indexes, but the time consumed on adding new objects.
I noticed that the first country has an orderedCollection with 295 cities.
So I save these cities first (540652 ms for the 295 cities) and then,
when I save the first ten countries, the elapsed times descended to 14
seconds.
Then I tried saving a new country, without any reference. It took 3
seconds (sometimes 2 or 1.5). It's slow...  But I really like Magma.
Thanks for your time And sorry again. I will study more on magma
before make another question.
Norberto







On 4/17/06, Chris Muller <chris at funkyobjects.org> wrote:
>
> > Sorry for bother you with these elementary questions.
>
> No bother!
>
> > I am playing with differentes keySizes in indexes, but everytime I
> > change the keySize of an index and rebuild the database Squeak hungs
> > (or it takes too much time to do the task).
>
> #keySize: is an 'initializing' method.  You cannot change the keySize
> of an index, but you may remove the old index and create a new index
> with a different keySize.
>
> > I'm saveving only 200 objects in a one single entry with two indexes.
>
> By "one single entry with two indexes" do you mean, one single
> MagmaCollection with two indexes?
>
> > The first time I save them, its very fast, but when I begin playing
> > with differents keySizes, Squeak loops.
>
> How are you "playing with different key sizes?  Its true that larger
> keys are significantly slower than smaller keys, but I don't think its
> looping endlessly..
>
> > Normally I close the session (a single user sesssion) and reopen it,
> > before to rebuild the database and the indexes, but I have tried even
> > deleting the db files and recreate them. I thought its must be
> > something about references that remains in my image, so I try to find
> > how to perform a garbageCollect of Magma. I found a comment in
> > MagmaCompressor that says "yourRepositoryController garbageColllect".
> > But this object does not understand #garbageCollect, nor any other
> > magma object.
>
> To "rebuild the database" I presume you mean to load it from some
> source?  If so, this advice will help you go faster:
>
>   http://minnow.cc.gatech.edu/squeak/2985
>
> If you decide to keep going, I will help the best I can.
>
>  - Chris
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>


More information about the Magma mailing list