Caché

Hi All,

We have few queries which are simple selects . For simplicity let's say there is a query that joins two tables and gets few columns and both tables have no indexes.

Select Tab1.Field1, Tab2.Field2
From Table1 Tab1
Join Table2 Tab2
On Tab2.FK = Tab1.PK

When we do query plan for this it shows approx 6 million,  however if we make a simple adjustment to the query

0   0 2
83

views

0

rating

This is a lesson learned, which I would like to share with community.  


Recently I ran into an issue, where I was using %ConstructClone and it kept cloning extra records, which were not needed.  The record for which I was trying to run a clone had many-to-one relationships.  

The solution to this issue was using param -1.  If you run %ConstructClone(-1) it will not clone relationships, but rather just clone single oref as desired in this case.


I hope this information helps someone who is working with similar records.

+ 4   0 1
0

comments

40

views

+ 4

rating

Hi Community!

Coding guidelines discussion. Consider you have For with one command in the cycle. Here are the options:

One

For i=1:1:1000 set ^Test(i)=""

Two

For i=1:1:1000 {
 set ^Test(i)=""
}

Same for the "If":

if a set b=a

or

if a {
 set b=a
}

Your choice? Or maybe even other options? 

Last comment 23 October 2019
+ 2   1 17
1,079

views

+ 2

rating