Clarion 11 with MSSQL Extremely Slow with Browses across more than one MSSQL Database

Tags: #<Tag:0x00007f22505dae20>

Hello Everyone

I would be most appreciative if anyone could assist please.

One of my major apps works on data from a number of companies. The data from each of these companies is stored in Private MSSSQL Databases. There is however common data between all companies that I have have moved into a “SharedTables” database.

I have changed my data dictionary appropriately and have two different connection strings for the tables in the SharedTables and in the Private Tables databases.

I have noticed that if I load an ABC Browse where there is a join between a table in the Shared Database and Private Database, my Browses are now degraded. ie. typically from 0.5 seconds previously to in the region of 45 seconds - to display the browse. When I return the table in question back to the Private Tables database - (thus no data in any other database) the speed is once again restored to its former glory.

Has anyone noticed this before?
Is anyone able to provide me with any insight into this please?
Is there something that I need to do to work around this?

Any assistance greatly appreciated.

Thanks
G

I’d use Clarion driver tracing to see where the delay actually is.
I’d also double check the DNS settings, DNS problem/fall back can cause that sort of thing.

As Sean suggests, tracing would probably be informative.

Are permissions the same on both databases (connections)?
Do you have BUSYHANDLING correctly set before a file is open on each connection?

For common data that’s static, I generally download that into an in-memory table when the app starts.

Another thing you can do is to create a view in each client database that joins the Shared and Private tables and returns a result set.
Import that into your dictionary and see whether things run faster.

1 Like

Yes, this is a well-known issue I discovered as well. You can’t join tables from different databases. Because of different connections (in Clarion terms).

As a simple workaround just create a View (SQL part) in your main database, this View will point your table in your second database. And then you can use this View (defined as a Table in DCT) in JOIN. Since they are both in the same database (and the same connection) you will have no slow issue…

2 Likes

Hi Jane

I have had many problems when changing the options for the MSSSQL connections. So the best result to date by far has been to have the options as blank.

Do you know where I can get more information on exactly how to create a MSSSQL view to implement in an ABC browse - because it sound exactly what I need - and I have never done this before.
Thanks
G

Hi Sean
DNS set correctly - it has been confirmed. To check further I decided to run the app ON the MSSQL server - and got the same results - but only when 2 databases are concerned.

you can easily create a SQL VIEW, like below

on your main database

CREATE VIEW [dbo].[CWTOWN]
AS
SELECT       *
FROM  YOUR_SECOND_DATABASE.dbo.CWTOWN
1 Like

Hi, Grant,

We’ll agree to disagree on the MSSQL connection options.

As for a view, you can create a raw view containing everything from a table in your second database as Guennadi describes.

But you can also do your joining on the server and create a view with the columns you actually need from both tables that you were joining in your Clarion browse.

Such as

CREATE VIEW dbo.myView
AS
SELECT m.itemName,m.itemCategory,i.price,i.taxRate,i.companyBrand
FROM yourIndividualDatabase.dbo.customerItems AS i INNER JOIN
yourSecondDatabase.dbo.masterItemTable AS m
ON i.itemId = m.itemId;

Then you can go into the Clarion dictionary editor and import that view just as if it is a table.
The only place that gets tricky is if you’re inserting and/or updating data. There’s plenty of online help about that.
You can also create a “filtered view” to limit the records (such as only non-obsolete products, or whatever).

2 Likes

I suspect the issue here is that you are loading data in one browse from different connectionstrings in the same file schematic. The way Clarion solves this is loading one dataset (connection) and fetching corresponding records in the other datasset (connection). You should be able to confirm this by analyzing the queries in a Clarion Trace.
The solution could be to use the same connectionstring and use linked the databases. If that is not possible, try loading data manually in a queue or reducing the dataset with filters as much as possible.

2 Likes

Why not link your shared database to all of the private databases and then hand-code your queries? I’ve used this technique in the past and haven’t seen any big performance issues.

1 Like