all groups > sql server odbc > october 2007 >
You're in the

sql server odbc

group:

Performance get bad if not using "Use Ansi Nulls, Spaces, ..." in



Performance get bad if not using "Use Ansi Nulls, Spaces, ..." in johnny72
10/24/2007 7:04:00 AM
sql server odbc: I Want to select from an MSSQL-Server datatbase and realised, that if i do
not use the flag mentioned above, the select takes much longer

I'v got 2 tables with indices:

create table XXX (S1 varchar (30) NOT NULL PRIMARY KEY, S2 int NOT NULL)
create unique index Idx_X1 on XXX (S2)
create table YYY (S1 varchar (30), S2 int FOREIGN KEY REFERENCES XXX(S2))
create unique index Idx_Y1 on YYY (S2)

I'm connecting to the database via the native Microsoft ODBC-driver.

Applying the following statement

select Y.S1 from YYY Y left outer join XXX X on X.S2=Y.S2 where X.S1=?;

via Windows SQL-Api in c++ for each record in Table XXX (I tried it with
1000 records) takes about 0,3s alltogether, if the flag "Use Ansi Nullls .."
in the driver Configuration is checked. 5s if the flag is not checked. 5
seconds seem quite a lot of time for this task and are actually too slow for
my application, as in the end i want to select far more than 1000. I would
set the driver-flag at once, if then the size of the database would not grow
much faster.

Has anybody had this problem before, or maybe even solved it?
AddThis Social Bookmark Button