Question Dmitrii Baranov · Jan 20

Why do these clauses affect SQL performance?

select ID from some_table where row_status in ('I','U') order by ID limit 5 - makes the query infinite select top 10 ID from some_table where row_status in ('I','U') order by ID - the same select ID from some_table where row_status in ('I','U') order by ID - is fast

Actually there are no rows in the table having row_status 'I' or 'U'.

I asked Gemini and it recommended me rewrite the query as

select ID from table where row_status in ('I','U') order by ID || '' limit 5,

15
0 153
Question Dmitrii Baranov · Jan 14

I have a Postgres table which should be migrated to IRIS. The table has a computed column, like:

CREATE TABLE example_table (
    id VARCHAR(10) PRIMARY KEY,
    normalized_id VARCHAR(10) GENERATED ALWAYS AS (LPAD(id, 10, '0')) STORED
);

IRIS also has the LPAD function but I can't figure out how to achieve the same result using pure SQL DDL.

Tried this:

CREATE TABLE example_table (
    id VARCHAR(10) PRIMARY KEY,
    normalized_id VARCHAR(10) COMPUTECODE {
        set {normalized_id} = LPAD({id}, 10, '0')
    }
    COMPUTEONCHANGE(id))

Got the following error:

7
0 95
Question Dmitrii Baranov · Dec 21, 2025

I have a business service that actively reads data from a remote Postgres database. OnProcessInput opens a XDBC (actually JDBC) connection, executes an SQL query, fetches several thousand rows, iterates the resultset, and closes the connection. On each iteration I also need to update each source row in the remote database using PreparedStatement.

In other words, in every OnProcessInput call I have a long running SELECT statement and several thousands small UPDATE statements.

The problems I'm facing are:

11
0 135
Question Dmitrii Baranov · Dec 19, 2025

I am experimenting with OpenTelemetry and recently connected all IRIS instances to telemetry servers. I'm not interested in emitting custom metrics since IRIS does it fine, regarding tracing - we can use %Trace classes to emit custom traces, but what about logging?

I see that IRIS is able to send system log messages to the OpenTelemetry servers:

{
  "when": "2025-12-10 10:46:25.185",
  "pid": "11852",
  "level": "SEVERE",
  "event": "Generic.Event",
  "text": "ISCLOG: CSPServer  Error displaying login page $ZE= ns=TEST rtn=%SYS.cspServer ...(repeated 2 times)"
}
0
0 63
Question Dmitrii Baranov · Dec 9, 2025

I need to connect IRIS to a third-party FHIR server which in turn is connected to Keycloak.

For machine-to-machine communications, client credentials grants should be used. I don't know why exactly but the FHIR server requires access tokens to contain the "openid" scope, otherwise it returns 401 (unauthorized).

If the access token returned by Keycloak contains that scope, IRIS complains about ""ERROR #8859: Unsupported response to access token request: OpenID Connect is not supported for password and client credentials grant type". The error is produced by the OAuth2.Response class, line 393:

2
0 72
Question Dmitrii Baranov · Oct 12, 2025

I need to build an integration solution that reads messages from a Kafka topic. The topic has 3 partitions and contains several million messages.

For certain reasons, I can only use the standard EnsLib.Kafka.Service class and cannot use either KafkaClient or Python.

To measure performance and collect statistics I created a simple key + timestamp table with no indexes (so it is unlikely to be a bottleneck). Next, I started an instance of EnsLib.Kafka.Service. In the OnProcessInput method, I receive a message, extract the key from it, get the current time, and write the row to the table.

5
0 79
Question Dmitrii Baranov · Aug 8, 2025

I have a table with 5M rows, the table contains lab observation codes and display names, both columns have type varchar(2000) and both are indexed.

The query looks like:

select code_1_text, count(code_1_text)
  from demo.observation_lab
  group by code_1_text
  order by 2 desc

The table contains ~1000 distinct display names.

It takes 4 minutes for the query to complete on a VM with some pretty old Xeon, 4 cores, 32G RAM, NVME SSD and Linux on board.

Isn't it too slow? During the execution I see no active hardware resources consumption - CPU load is 12-25%, RAM is almost free, swap file is not used.

4
0 122
Question Dmitrii Baranov · Mar 31, 2025

I'd like to ask you for recommendations on how to properly use repository dependencies when using VSCode and Client-side editing. Suppose I have projects A, B and C, with A being independent, B depending on A, and C depending on A and B. I am currently working with the main project C, and I want to be able to contribute to all the other projects in a single VSCode window (instead of opening three instances). How do you solve this problem? Git submodules? ZPM? Something else?

1
0 121
Question Dmitrii Baranov · Mar 18, 2025

I have two instances of IRIS, one is Production and another one is Staging (both managed by Docker) and I want to set up a full daily recover of the Staging server from a full backup of the Production server. I know how to do this manually using the DBREST utility, as well as how to make a copy of the database by making a full copy of the durable directory (however this option requires a full stop of the Production-database). What is the best way to automatically restore all databases from a full backup using scripting?

1
0 112
Question Dmitrii Baranov · Dec 17, 2024

I have a business service which is responsible for some batch operations with an SQL table. The process is generally slow but it is possible to scale the performance using multithreading and/or parallel processing and logical partitioning (postgres):


select id, col1, col2, mod(row_number() over (), 4) as partition from some_table;

Thus, a partition index will be assigned to each table row. The idea is to create several instances of my business service using pooling (e.g. Pool Size = 4) so each business service instance will be responsible to hande rows belonging to a certain partition, e.g.:

6
0 192
Question Dmitrii Baranov · Dec 12, 2024

My IRIS instance is connected to a Postgres database using SQL Gateway and linked tables. One of these tables is projected to the Patient class. I want to select a record from this table by ID and convert it to a FHIR resource using the %ExistsId and %OpenId methods. I noticed that if I call these two methods from the console, the record is always found. But, if I do the same from the FHIR Facade layer, the %OpenId method returns NULL. The error is intermittent - yesterday FHIR Facade didn't work at first, then it worked, this morning when I try to select a patient record from the FHIR facade

1
0 136
Question Dmitrii Baranov · Dec 10, 2024

I am developing locally on my IRIS instance using VSCode and client-side editing approach. How can I automatically export a single .cls file/a whole package to a remote TEST/PREPROD server using a script or command line and recompile the unit remotely? Are there any more simple and straightforward ways than CI/CD explained in the series of articles by Eduard?

3
0 216
Question Dmitrii Baranov · Dec 1, 2024

I'm trying to call a SOAP web service which is implemented in .NET Classic and requires NTLM authentication. The client class was generated by %SOAP.WSDL.Reader. The problem is that neither NTLM authentication works nor can I handle the exception since VSCode debugger says that all meaningful fields and properties are empty (the same request works fine in Postman):

4
0 281
Question Dmitrii Baranov · Nov 27, 2024

I want to integrate IRIS with Keycloak OAuth2 provider to use delegated authentication everywhere and to secure everything - sys*/Portal applications, REST services, FHIR server and so on. If an unathenticated user tries to access any IRIS URL - he or she should be redirected to Keycloak. After the user has successfully authenticated, i would like to access his requistes (username, email, roles, scopes) extracted from the JWT token, programmatically. What should be done to achieve that? I found this repo but it seems a bit tricky to implement a custom ZAUTHENTICATE function which has an access

1
0 307
Question Dmitrii Baranov · Nov 17, 2024

I'm playing with some anayltic queries against FHIR server tables. The HSFHIR_X0002_S_Patient.addressCity table contains a lot of cities which names contain german charachers such as ä, ö and ü.

The following query works fine:

select value from HSFHIR_X0002_S_Patient.addressCity

But this one converts city names to uppercase, and characters with umlauts are lost, so instead of "Köln" or "München" I see KOLN and MUNCHEN:

select ac.value, count(ac.value) as cnt
  from HSFHIR_X0002_S_Patient.addressCity ac
  group by ac.value
  order by 2 desc

I'm using DBeaver with IRIS official JDBC driver.

2
0 132
Question Dmitrii Baranov · Nov 12, 2024

To transfer data between production components I actively use messages of type Ens.StreamContainer class and its descendants. In many cases the content of the message content is not visualised (the 'Body' tab contains a table with a list of selected message properties but the 'Contents' tab is empty). Response messages are never visualised, and request messages are visualised with a fifty-fifty probability. What do I need to do to ensure that messages are always visualised?

3
0 186
Question Dmitrii Baranov · Nov 2, 2024

I'm experimenting with FHIR bulk data load using NDJSONs, so far the import is running smoothly, but when I'm trying to perform a request of kind /Patient or /Procedure I'm getting back the following error:

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "too-costly",
            "diagnostics": "<HSFHIRErr>SearchTooCostly",
            "details": {
                "text": "Search selects more than maximum allowed number of results (1000)."
            }
        }
    ]
}
2
0 213
Question Dmitrii Baranov · Feb 26, 2024

IRIS is known to have a built-in Python bridge and even allows you to write Python server code but what about JavaScript? Let's say I need a JavaScript expression interpreter. What would you recommend as the most effective way to get one? It is highly desirable that the solution does not require administrator privileges and uses in-process communication (I mean not http and not unix-specific interprocess-communication via command line)

2
0 225
Question Dmitrii Baranov · Oct 21, 2023

Hi, How can I get an instance of stream which is a successor of %Stream.Object in a method that handles a REST POST request?

#dim request as %CSP.Request = %request
 set content = request.Content

This returns a variable of type %CSP.Stream which is totally useless, because %CSP.Stream does not inherit from %Stream.Object

2
0 330