Arto Alatalo · Feb 25, 2023 go to post

That's weird, ##class(loggpro.IndexTest).%BuildIndices() indeed recreates the index properly. But the way I do it, with Portal's SQL, Rebuild Index just wipes the index out. Please check how Portal works for you.

Arto Alatalo · Feb 24, 2023 go to post

Now all my fields are of type %Library.Integer but Rebuild Index still just deletes ^mytest("idx"). Does Rebuild Index work for you?

Arto Alatalo · Feb 23, 2023 go to post

Here it is. InsertData properly creates both ^mytest("data") and ^mytest("idx"). Rebuild Index does nothing except deletes ^mytest("idx").

Class loggpro.IndexTest Extends%Persistent [ ClassType = persistent, ProcedureBlock, SqlCategory = INTEGER, StorageStrategy = itemstore ]
{

Property aaa;Property bbb;
Index prim On aaa [ IdKey, PrimaryKey ];
Index idxBbb On bbb;ClassMethod InsertData()
{
	for a=1:1:10 {	
		s o=##class(loggpro.IndexTest).%New()
		s o.aaa=a
		s o.bbb=a+100d o.%Save()
	}
}

Storage itemstore
{
<SQLMap name="indexmap">
<Global>^mytest</Global>
<PopulationType>full</PopulationType>
<Subscript name="1">
<Expression>"idx"</Expression>
</Subscript>
<Subscript name="2">
<Expression>{bbb}</Expression>
</Subscript>
<Subscript name="3">
<Expression>{aaa}</Expression>
</Subscript>
<Type>index</Type>
</SQLMap>
<SQLMap name="itemmap">
<Data name="bbb">
<Node>"bbb"</Node>
</Data>
<Global>^mytest</Global>
<Subscript name="1">
<Expression>"data"</Expression>
</Subscript>
<Subscript name="2">
<Expression>{aaa}</Expression>
</Subscript>
<Type>data</Type>
</SQLMap>
<StreamLocation>^CacheTemp</StreamLocation>
<Type>%CacheSQLStorage</Type>
}

}
Arto Alatalo · Feb 20, 2023 go to post

I have a question regarding to the indexing: for me example shown in the article works fine, the index global is populated property for inserted records but then I have two problems:

- Rebuild Index just deletes the whole index global and creates nothing instead.

- Show Plan indicates that my index cannot be used directly when selecting on the indexed property. Instead, the executor has to create a temporary map applying %SQLUPPER to the property.

Any advice how to make fully compatible index?


Cache for Windows (x86-64) 2018.1.5

Arto Alatalo · Mar 10, 2022 go to post

Hi Robert,

JRNDUMP does solve the timeout issue, but searching with it looks really challenging.

Arto Alatalo · Nov 1, 2021 go to post

I've never worked with NET client but I suppose it works on request/response principle, so it is not possible to get async call from the database.

Arto Alatalo · Aug 23, 2021 go to post

Great article! Thank you for sharing your experience and thoughts with us.

Arto Alatalo · Jun 6, 2020 go to post

minimum platform version of InterSystems IRIS 2018.1

Porting old apps with a framework available on new version of the platform (IRIS) only, no contradictions here? :) Is there something fundamental preventing the framework from being used on Cache too?

Arto Alatalo · May 20, 2020 go to post

@Murray Oldfield 

I'm getting similar error with latest container version:

ValueError: time data '19.05.2020' does not match format '%d/%m/%Y'

19.05.2020 00:00:00
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0,75    0,00    0,10    0,04    0,00   99,11
Arto Alatalo · May 16, 2020 go to post

@Murray Oldfield 
Current version of documentation says regarding to the update

https://cedocs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=GCM_pbuttons#GCM_pButtons_runsmp
This utility may be updated between releases. The latest version is available on the WRC distribution site under Tools

The xml indeed can be downloaded from WRC but no word neither about pButtons version not the way to install it. Should I simple import the xml into %SYS?

Arto Alatalo · May 13, 2020 go to post

Hi Daniel,

well, my problem is as simple as this: I have data of same structure stored in two different globals and I want to read it with  SQL-mapped storage. It would be too boring to have two identical classes with the only difference in the location.

Arto Alatalo · May 8, 2020 go to post

Oho, that's interesting. I've never heard about NextCode feature.  Thank you.

Global name indeed can be passed with a class parameter this way

<NextCode>s {L1}=$o(@("^"_##class(Mapping.TwoGlobals).#TableName)@({L1}))  </NextCode>

but the query execution fails with a SYNTAX error that I haven't solved so far.

Arto Alatalo · May 6, 2020 go to post

With IS support's help this issue is solved now. There were some mistakes in the installation of the Cache instance causing some permission troubles. Thanks for your time.

Arto Alatalo · May 5, 2020 go to post

Thank you for this interesting info. But indeed on first place I'm interested to know why the system always worked fine on Windows (with very same load) but fails on Linux.

Arto Alatalo · May 5, 2020 go to post

Thank you Nick. I've checked the log and have found exactly same reason: oom-killer killed a Cache process. How did you solved the problem? Do you know why Cache eats memory over the limits at first place?

Arto Alatalo · May 1, 2020 go to post

This IDKEYOpen looks as capricious beast. Because of some reasons digi.packet has no such method. But its sibling class do have it although in lowercase:

zidkeyOpen(K1,K2,concurrency=-1,sc) public { Set:'($data(sc)#2) sc=1
Quit ..%OpenId(K1_"||"_K2,concurrency,.sc) }

A few other classed  have IDKEYOpen in upper case:

zIDKEYOpen(K1,concurrency=-1,sc) public { Set:'($data(sc)#2) sc=1
Quit ..%OpenId(.K1,concurrency,.sc) }

Looks as the compiler generates this method only in some cases. But why in lower case? Strange.

What for the performance, the method looks as a very simple wrapper around %OpenId, so no much performance difference to expect.

Arto Alatalo · May 1, 2020 go to post

You wrote:

if I was not concerned with concurrency as I just wanted to read data I would use option 0.

Just to see how much gain I can have, I compared options 0 and 1, and the diff is surprisingly small: the test with 0 takes 34 secs, and with 1 takes 35. I would expect a bigger difference.

Arto Alatalo · May 1, 2020 go to post

Yes, for sure pure global reading is not the same as Open. With this test I just wanted to make sure the slowness is not related to global access speed.

Arto Alatalo · Apr 30, 2020 go to post

No, this is not my case :) I've exact copy of the test method on each machine.

I can see some difference between the methods: with p existing, each next Open spends some time checking if the object already open.  But 12 times... I wonder what makes it.

Thanks for your time.

Arto Alatalo · Apr 29, 2020 go to post

Yes, I can try it but how do you mean it is related to my problem? My problem is that my laptop executes very same code against very same database 6 times faster than powerful idle server.

Arto Alatalo · Apr 29, 2020 go to post

Hi Alexander,

how did you realize that you have to adjust the buffers? What kind of problems you had?

Arto Alatalo · Apr 29, 2020 go to post

Hi Eduard,

no, it is not parent-child relationship, it's composite primary key, and I have good reasons for it.

Arto Alatalo · Apr 29, 2020 go to post

For sure there are tons of differences in the hardware! And the price is primary of them! The productions server cost is I guess like ten of my developing laptops. And this is one of the reasons I expect the server be fast :)

Thanks. Yes, I'm now automatically collecting execution time every 15 mins to check the performance overnight when all the users are gone.

Arto Alatalo · Apr 29, 2020 go to post

Good idea! Never heard about BENCHLANG before. The server is almost idle at night time so now I know what it can do in its spare time.

Arto Alatalo · Apr 29, 2020 go to post

>is there any other load on the server that could have influence ? 

The load is first explanation I had in mind.  But I've done the comparison several times with server load near to none.