Ladies and gents -
I'm working with someone who has proposed using a linked server against (Informix) in SQL Server.
They've found (for reasons unknown) that they have better luck with client tools connecting to SQL, and SQL Server proxying SQL statments to Informix then pointing the client tools directly at Informix. My thought, of course is "Solve the Client > Informix connectivity problem, don't use a hack" - but that's besides the point and probably not negotiable by yours truly.
That being said, what are the dangers of this approach in terms of performance?
My question:
Can anyone identify scenarios where a "GROUP BY" question fired at SQL Server would cause the individual, granular rows to be returned to SQL Server and aggregated there vs. on Informix? That's the apocalypse as far as I'm concerned.
Are there other (bad) performance implications that using a linked server in this type of situation that I should be aware of (and use as way of trying to simplify the solution and go client > Informix)?
Thanks!
Linked Servers are an easy way to connect between different SQL Server instances without too much hassle and application development overhead. But, if not configured correctly, they can also serve as a dangerous security vulnerability.
The performance of Linked Servers is not always great, especially with large data sets and lots of joins between local and linked tables. But they can be very useful for querying smaller datasets.
Problem #2: linked servers don't cache data. Even worse, it penalizes both servers involved with the linked server query. It's hard on the local server, and it's hard on the remote server that holds the single source of truth for the table.
A linked server is used to connect to another (remote) database or file (Xls, CVX) using SQL Server Management Studio (SSMS) and discover the data or objects. You can write SQL queries from your SSMS directly on a database on another machine.
If you use the linked server on a query directly from SQL Server on the form of:
SELECT Col1, col2, col3, SUM(col4)
FROM LinkedServer.Database.schema.Table
GROUP BY Col1, col2, col3
Then it will perform the aggregations on SQL Server. But if you use OPENQUERY
or OPENROWSET
, then it will perform the query on the linked server and then retrieve the data to SQL Server:
SELECT *
FROM OPENQUERY(LinkedServer, '
SELECT Col1, col2, col3, SUM(col4)
FROM Database.schema.Table
GROUP BY Col1, col2, col3')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With