OpenEdge 12.1 was released in September of 2019. Did you know that it extends the new server-side join (SSJ) support introduced in 12.0 to dynamic queries?
OpenEdge 12.0 introduced the SSJ functionality with the FOR statement. In OpenEdge 12.1, you can now use the SSJ functionality with FORWARD-ONLY, NO-LOCK dynamic queries. In this post, we share a tutorial to ease your ability to implement.
Optimizing the performance and scalability of an application were priorities in our delivery of OpenEdge 12. The database improvements in particular have been shown to significantly increase throughput—in some instances by 3x. The multi-threaded Database Server of OpenEdge 12 processes remote client requests concurrently, significantly improving database performance under load without requiring any application coding changes. To further enhance performance, OpenEdge 12 performs server-side joins with FOR-EACH queries that join multiple tables. These queries are now resolved in the database server rather than the client, and no coding changes are required. As a result, fewer records are typically returned to the client, leading to faster performance.
Server-side join supports up to 10 tables joined in the same logical database. Any query that cannot currently be resolved on the server side continues to operate as usual. With OpenEdge we furthered the capability by providing the ability to execute dynamic queries with joins on the server-side to improve performance of ABL queries.
Applications using an n-tier architecture connect to the database via network parameters. In this scenario, the client can be a GUI client, a TTY client or an agent process in PASOE. In previous versions (without SSJ), the resolution of a join would require the server to send records from the parent table to the client even if they were not a match in the join.
Ultimately, server-side join (SSJ) processing improves performance by resolving queries on the server and reducing the data sent over the network. SSJ is enabled by default, and is used to resolve joins that meet all the following conditions:
Let’s take a closer look at how this is implemented.
The server-side join functionality is controlled by the -ssj database parameter.
By default, the database uses -ssj 1. The use of server-side join can be turned off by specifying -ssj 0 as a startup parameter when starting the database broker with PROSERVE.
The multi-threaded server (MTS) functionality should also be enabled for the server-side join to operate. MTS is also enabled by default.
You can use –ssj 0 if you want to turn off the functionality—for example, if you are analyzing the gains from using SSJ in your application.
Parameters |
Server-Side Join |
-threadedServer 1 |
Enabled (default) |
-threadedServer 1 |
Disabled |
-threadedServer 0 |
-ssj 1 is ignored because the multi-threaded server is not enabled. |
-threadedServer 0 |
Disabled |
The following program shows a join using the FOR statement. The connection to the database is done using network parameters so that SSJ can be used.
Here are the steps to run the sample program using SSJ on a system with OpenEdge 12.1 installed:
The connection to the database is done using the network parameter “-S 20000”. A client/server connection is established. The program SSJ1.p runs and displays the elapsed time for the query.
You can run the program on the same machine or on a remote machine as the database server.
When you run your program with SSJ, the performance is much faster. (In case you need to compare the performance with and without SSJ, the next section provides the steps you need to run without SSJ.)
You may ask: How fast is the performance? And you might simply answer, “very fast.”
Notes:
To turn off SSJ so that you can gain a performance comparison, follow these steps:
The difference with the steps in the previous section is that the “-ssj 0” option is used to disable SSJ.
When you test performance, you might want to shut down and restart the database broker so that improvements in the query execution are not associated with the caching of blocks or records.
The performance when you disable SSJ (-ssj 0) will be much slower.
Here are the steps to run the sample program using SSJ on a system with OpenEdge 12.1 installed:
The connection to the database is done using the network parameter “-S 20000”. A client/server connection is established. The program SSJ2.p runs and displays the elapsed time for the query.
The sample program uses a FORWARD-ONLY dynamic query with NO-LOCK.
You can analyze the execution of a query using the QryInfo logging option.
Follow these steps to run the sample program without SSJ with QryInfo logging on a machine with OpenEdge 12.1 installed:
-clientlog client.log -logentrytypes QryInfo -logginglevel 3
Follow these steps to run the sample program using SSJ with QryInfo logging on a machine with OpenEdge 12.1 installed:
-clientlog client.log -logentrytypes QryInfo -logginglevel 3
In the screenshot, you can see the output of using QryInfo logging, with the sample program using a dynamic query. The left side shows the output when server-side join is disabled, and the right side shows the output with server-side join enabled (default).
Check out the introduction and demo videos here and get a closer and get a closer look:
For more information on server-side joins, check out these slides from a recent presentation by OpenEdge Development Fellow Richard Banville, “OpenEdge 12.0 Database Performance and Server-Side Joins,” or feel free to explore the Progress Information Hub links below:
The server-side join processing functionality in OpenEdge 12.x delivers great performance out-of-the-box.
Here are some of the things that we learned:
Have you seen the performance improvement of SSJ in your application?
How much performance have you gained? 2x, 3x? Please let us know in the comments.
Stay tuned. More enhancements to SSJ are coming. And if you don’t yet have OpenEdge 12.1 and want to test out the functionality for yourself, you can start a free trial today.
Thank you for reading.
Edsel Garcia is a Software Architect in the Progress OpenEdge Engineering group. Edsel has a long history of first-hand experience using Progress products, starting as a customer and application developer more than 25 years ago. During his over 20-year tenure at Progress, Edsel has been a member of many teams, including Customer Support, Solution Engineering development, Tooling development, OpenEdge Architect product development and more. Edsel has recently been working on the Docker Container for PASOE project and CI/CD for OpenEdge with High Availability.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites