Tuesday, March 20, 2012
RDO resultset performance problem
I have a big performance problem with looping threw rdoresultset.
I made some very complex sql queries. They link like 5 tables and uses a
couple subqueries. The number of returned rows is something like 1000. Query
execution takes about 1 second, which is completly acceptable. But before I
can display result to the user, I need to perform some calculations over
returned rows. To loop threw resultset (movenext) takes 2 seconds, which is
VERY slow! The procedure is very optimized, so each value in resultset in
fetched only once. How can I access all data in the resultset in a much more
efficient way? I do not need to update any row, all I need to is to get
values from resultset.
Query is optimized for fast data access. I can not perform arithmetic
operations directly in query. The amount of data returned by the server is
something like 15kb, which is very small. I am using RDO and cursor library
is rdUseOdbc. For resultset I tryed to use different parameters, ie
readonly, forwardonly,... but performance does not change. And the server I
uses is SQL serer 2000.
Any idea would be really appreciated!!
Marko Erzen
Please note that RDO is deprecated so you might want to look into using
equivalent technologies in .NET or if you must do Native code, ADO.
This posting is provided "AS IS" with no warranties, and confers no rights.
Regards,
Uwa Agbonile[MSFT]
"Marko Erzen" <mare@.email.si> wrote in message
news:uNXiOSZbFHA.2440@.TK2MSFTNGP10.phx.gbl...
> Hi to all,
> I have a big performance problem with looping threw rdoresultset.
> I made some very complex sql queries. They link like 5 tables and uses a
> couple subqueries. The number of returned rows is something like 1000.
Query
> execution takes about 1 second, which is completly acceptable. But before
I
> can display result to the user, I need to perform some calculations over
> returned rows. To loop threw resultset (movenext) takes 2 seconds, which
is
> VERY slow! The procedure is very optimized, so each value in resultset in
> fetched only once. How can I access all data in the resultset in a much
more
> efficient way? I do not need to update any row, all I need to is to get
> values from resultset.
> Query is optimized for fast data access. I can not perform arithmetic
> operations directly in query. The amount of data returned by the server is
> something like 15kb, which is very small. I am using RDO and cursor
library
> is rdUseOdbc. For resultset I tryed to use different parameters, ie
> readonly, forwardonly,... but performance does not change. And the server
I
> uses is SQL serer 2000.
>
> Any idea would be really appreciated!!
> Marko Erzen
>
RDO resultset performance problem
I have a big performance problem with looping threw rdoresultset.
I made some very complex sql queries. They link like 5 tables and uses a
couple subqueries. The number of returned rows is something like 1000. Query
execution takes about 1 second, which is completly acceptable. But before I
can display result to the user, I need to perform some calculations over
returned rows. To loop threw resultset (movenext) takes 2 seconds, which is
VERY slow! The procedure is very optimized, so each value in resultset in
fetched only once. How can I access all data in the resultset in a much more
efficient way? I do not need to update any row, all I need to is to get
values from resultset.
Query is optimized for fast data access. I can not perform arithmetic
operations directly in query. The amount of data returned by the server is
something like 15kb, which is very small. I am using RDO and cursor library
is rdUseOdbc. For resultset I tryed to use different parameters, ie
readonly, forwardonly,... but performance does not change. And the server I
uses is SQL serer 2000.
Any idea would be really appreciated!!
Marko ErzenPlease note that RDO is deprecated so you might want to look into using
equivalent technologies in .NET or if you must do Native code, ADO.
This posting is provided "AS IS" with no warranties, and confers no rights.
Regards,
Uwa Agbonile[MSFT]
"Marko Erzen" <mare@.email.si> wrote in message
news:uNXiOSZbFHA.2440@.TK2MSFTNGP10.phx.gbl...
> Hi to all,
> I have a big performance problem with looping threw rdoresultset.
> I made some very complex sql queries. They link like 5 tables and uses a
> couple subqueries. The number of returned rows is something like 1000.
Query
> execution takes about 1 second, which is completly acceptable. But before
I
> can display result to the user, I need to perform some calculations over
> returned rows. To loop threw resultset (movenext) takes 2 seconds, which
is
> VERY slow! The procedure is very optimized, so each value in resultset in
> fetched only once. How can I access all data in the resultset in a much
more
> efficient way? I do not need to update any row, all I need to is to get
> values from resultset.
> Query is optimized for fast data access. I can not perform arithmetic
> operations directly in query. The amount of data returned by the server is
> something like 15kb, which is very small. I am using RDO and cursor
library
> is rdUseOdbc. For resultset I tryed to use different parameters, ie
> readonly, forwardonly,... but performance does not change. And the server
I
> uses is SQL serer 2000.
>
> Any idea would be really appreciated!!
> Marko Erzen
>
RDO resultset performance problem
I have a big performance problem with looping threw rdoresultset.
I made some very complex sql queries. They link like 5 tables and uses a
couple subqueries. The number of returned rows is something like 1000. Query
execution takes about 1 second, which is completly acceptable. But before I
can display result to the user, I need to perform some calculations over
returned rows. To loop threw resultset (movenext) takes 2 seconds, which is
VERY slow! The procedure is very optimized, so each value in resultset in
fetched only once. How can I access all data in the resultset in a much more
efficient way? I do not need to update any row, all I need to is to get
values from resultset.
Query is optimized for fast data access. I can not perform arithmetic
operations directly in query. The amount of data returned by the server is
something like 15kb, which is very small. I am using RDO and cursor library
is rdUseOdbc. For resultset I tryed to use different parameters, ie
readonly, forwardonly,... but performance does not change. And the server I
uses is SQL serer 2000.
Any idea would be really appreciated!!
Marko ErzenHi
As you don't show code then it is not possible to say if your evaluation
that the work can not be done in T-SQL is correct. You don't say how you are
connecting, but using OLEDB and not ODBC would help. If you have to use ODBC
makes sure that you are not using tracing on the ODBC connection. Also try
using rdUseServer instead of rdUseODBC. You may also want to see if ADO
performs better.
John
"Marko Erzen" wrote:
> Hi to all,
> I have a big performance problem with looping threw rdoresultset.
> I made some very complex sql queries. They link like 5 tables and uses a
> couple subqueries. The number of returned rows is something like 1000. Que
ry
> execution takes about 1 second, which is completly acceptable. But before
I
> can display result to the user, I need to perform some calculations over
> returned rows. To loop threw resultset (movenext) takes 2 seconds, which i
s
> VERY slow! The procedure is very optimized, so each value in resultset in
> fetched only once. How can I access all data in the resultset in a much mo
re
> efficient way? I do not need to update any row, all I need to is to get
> values from resultset.
> Query is optimized for fast data access. I can not perform arithmetic
> operations directly in query. The amount of data returned by the server is
> something like 15kb, which is very small. I am using RDO and cursor librar
y
> is rdUseOdbc. For resultset I tryed to use different parameters, ie
> readonly, forwardonly,... but performance does not change. And the server
I
> uses is SQL serer 2000.
>
> Any idea would be really appreciated!!
> Marko Erzen
>
>|||Hi
If I use the rdUseServer then query executes four times slower. But movenext
method is fast, very fast. The total duration of the query and local
processing is almost equal using the tdUseODBC. But in this case all other
queries in the application slows down too much. So rduseServer is not a good
option.
I also tryed using the ADO connection. The performance is almost the same as
using the RDO object. And I am not tracing queries.
Here is a chunk of the SQL in question:
SELECT am.datum, rtm.hotel_code, rtm.summary_code, rtm.room_type,
rtm.regular_rooms AS total_rooms, restm.definite,
ISNULL((SELECT SUM(ISNULL(re.nr_of_rooms,0)) FROM
reservations re,
reservation_type rest
WHERE re.reservat_type = rest.reservat_type AND
re.reservation_nr > 0 AND re.reservation_nr = re.group_res_nr AND
NOT (re.arrival < '2004-06-07' AND re.check_in = 0) AND
re.canceled_on IS NULL AND
((re.group_arrival <= '2004-07-02' AND re.group_departure > '2004-06-07') OR
(re.group_arrival = re.group_departure AND re.group_arrival = '2004-06-07'))
AND
re.group_arrival <= am.datum AND
re.group_departure > am.datum AND
rest.definite = restm.definite AND
re.hotel_code = rtm.hotel_code AND
re.summary_code= rtm.summary_code AND
re.room_type = rtm.room_type AND
am.datum BETWEEN '2004-06-07' AND '2004-07-02' AND
rest.definite IN (0) AND
re.hotel_code IN ('GHE','HH','HVP') ),0) AS occ_rooms ,
ISNULL((SELECT COUNT(DISTINCT roomstat_nr) FROM roomstat rs WHERE
rs.hotel_code = rtm.hotel_code AND
rs.summary_code = rtm.summary_code AND
rs.room_type = rtm.room_type AND
rs.fromdate <= am.datum AND
rs.todate > am.datum AND
rs.fromdate <= '2004-07-02' AND
rs.todate >= '2004-06-07' AND
am.datum BETWEEN '2004-06-07' AND '2004-07-02' AND
rs.hotel_code IN ('GHE','HH','HVP') ),0) AS oo
FROM avail am,
room_type rtm,
reservation_type restm WHERE
am.datum BETWEEN '2004-06-07' AND '2004-07-02' AND
rtm.regular < 5 AND
restm.definite IN (0) AND
rtm.hotel_code IN ('GHE','HH','HVP')
GROUP BY am.datum, rtm.hotel_code, rtm.summary_code, rtm.room_type,
rtm.regular_rooms, restm.definite
ORDER BY am.datum, rtm.hotel_code, rtm.summary_code, rtm.room_type,
restm.definite
"John Bell" <jbellnewsposts@.h0tmail.com> wrote in message
news:B97359C8-E1C1-4207-AA51-AA846D1FB9C7@.microsoft.com...
> Hi
> As you don't show code then it is not possible to say if your evaluation
> that the work can not be done in T-SQL is correct. You don't say how you
are
> connecting, but using OLEDB and not ODBC would help. If you have to use
ODBC
> makes sure that you are not using tracing on the ODBC connection. Also try
> using rdUseServer instead of rdUseODBC. You may also want to see if ADO
> performs better.
> John
> "Marko Erzen" wrote:
>
Query
before I
is
in
more
is
library
server I|||Hi
SUM(ISNULL(re.nr_of_rooms,0)) is not needed, you may get a warning for
nulls but it would expect nr_of_rooms to be not null with a default of
0.
You may want to use derived tables for your sub-queries. This is
usually quicker for larger result sets.
I would prefer to use JOIN syntax as this may make it clearer.
Look at the query plan and possibly try the index tuning wizard.
John
RDO or ADO
for report writing. I have the option to choose from ODBC
RDO and OLE DB ADO.
I would like to know which one should I choose ?
What is the difference between them and which one is more
efficient ?
Thanks
I suggest you use ADO since it is the successor to RDO.
Hope this helps.
Dan Guzman
SQL Server MVP
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:68a701c493bb$35cb4d60$a301280a@.phx.gbl...
>I am using Crystal Report 10 connected to SQL Server 2000
> for report writing. I have the option to choose from ODBC
> RDO and OLE DB ADO.
> I would like to know which one should I choose ?
> What is the difference between them and which one is more
> efficient ?
> Thanks
|||Peter,
Definitely ADO. Even though ADO is now obsolete (superceded by ADO.NET),
RDO is worse than obsolete. ADO replaced RDO years ago.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Peter wrote:
> I am using Crystal Report 10 connected to SQL Server 2000
> for report writing. I have the option to choose from ODBC
> RDO and OLE DB ADO.
> I would like to know which one should I choose ?
> What is the difference between them and which one is more
> efficient ?
> Thanks
Monday, March 12, 2012
RDO or ADO
for report writing. I have the option to choose from ODBC
RDO and OLE DB ADO.
I would like to know which one should I choose ?
What is the difference between them and which one is more
efficient ?
ThanksI suggest you use ADO since it is the successor to RDO.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:68a701c493bb$35cb4d60$a301280a@.phx.gbl...
>I am using Crystal Report 10 connected to SQL Server 2000
> for report writing. I have the option to choose from ODBC
> RDO and OLE DB ADO.
> I would like to know which one should I choose ?
> What is the difference between them and which one is more
> efficient ?
> Thanks|||Peter,
Definitely ADO. Even though ADO is now obsolete (superceded by ADO.NET),
RDO is worse than obsolete. ADO replaced RDO years ago.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Peter wrote:
> I am using Crystal Report 10 connected to SQL Server 2000
> for report writing. I have the option to choose from ODBC
> RDO and OLE DB ADO.
> I would like to know which one should I choose ?
> What is the difference between them and which one is more
> efficient ?
> Thanks
RDO DataType query.
A colleague is trying to get some SQL Server data into MS Access, and is querying the table from a VB program.
She opens an rdoconnection to an SQLServer database. When testing recordset.rdocolumns("fieldName").type it gives -9 as the value. This does not relate to any of VB's listed RDO connection types. It also shows the rdocolumns("fieldName").size as being twice what the database shows when viewed through Microsoft Access. What is this datatype?
Any ideas?
I've found various lists for datatype eNums for ADO, but nothing on RDO (as it's obviously obsolete). Anyone out there got any ideas (other than "use something else")?
Thanks in advance
Chris.
export the data from sql server using dts
call the dts from the apps using dts run utility
or
use ado
or use replication
RDO Connection through VB
I am using VB to connect to the database and I am using RDO (Remote Data Objects) for this connectivity.
For security reasons, I am using the userid and password retrieved from a different database to establish the connection to the production server. The password we retrieve is encrypted and the connection program decrypts that and connects.
All is fine so far. But after I connect to the database, in the VB project, in the debug mode, I can see the connection string by accessing the property RdoConnection.Connect.
Is there a way, by which, I could establish the rdoconnection and immediately after that, change the 'Connect' property of that to something else, so that it does not have the actual connection information?
Thanks in advance
RajI don't think so. When you change the connect property, I think you will lose the connection.
You could make the class that holds the RDO object private so that it is not remotely accessible. You should also make the RDO object private to the class, and provide write-only access to the connection string by creating a Let property with no Get property.
RDO 2.0 and Visual Basic 5 application stopped working with SQL Server 2005
We have a legacy application that is still in wide use. It is Visual Basic 5 and RDO 2.0 using ODBC to connect to SQL Server database.
When trying to connect to SQL Server 2005, it can no longer update or insert data. It reads data fine. The error message it gives is 16933, "The cursor does not include the table being modified or the table is not updatable through the cursor."
Has anybody else seen this problem? Any help would be appreciated.
Yes, we've seen this. It's hinted at in the documentation, although none of our examples seemed to exactly match what's documented. In several cases we were able to fix the problem by swapping the "from" table with a join table, but in one case we had to give up on the cursor.