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
82

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

38

views

+ 4

rating

Hi,

we're planning some work on our SQL Query Plan functionality for a future release of InterSystems IRIS and are interested to hear how you're using them today, or what'd keep you from using them. Rather than try and fit everything in a rigid survey, I thought a simple thread on our beloved DC might also reveal some use patterns that we support or could do a better job on. 

Last comment 10 January 2020
+ 3   0 3
80

views

+ 3

rating

Hi Developers!

Often we need to use relatively small arrays with constants, static arrays in algorithms, etc where we need to do something with each element of an array. There are several ways to deal with it in ObjectSctipt. 

Previously I used to use globals, locals, PPG for this but not so long time ago figured out that %List is a way too handy.

Indeed, suppose we have an array of months and need to set up and use it in our code.

Last comment 28 December 2019
+ 2   1 2
317

views

+ 2

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