Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Oleg Deribas
Sent: Wednesday, December 13, 2006 12:26 PM
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] Is dot net provider so slow or is
it me?

Hello,

bear007 said the following on 13.12.2006 8:26:

I'd add read-only transaction options to the code in order to lower
server's load:

> FbCommand cmd = new FbCommand();
> cmd.CommandText = "Select * from Table where POSTAL_CODE = 84652";
> cmd.Connection = conn;

cmd.Transaction = conn.BeginTransaction(FbTransactionOptions.Read |
FbTransactionOptions.ReadCommitted);

> FbDataAdapter da = new FbDataAdapter(cmd);
> da.Fill(dt);

cmd.Transaction.Commit();


> It can be so long, but a program called "IBEasy+" gets the same result
> with the same Query in about, i don't know... a small part of one
second :) 

I don't know how is it in IBEasy+, but in the IBExpert there is button
"Execute and fetch all records" - you sould try this and compare.

-- 
Oleg

Thank you all for help, It's true, isql gets all rows about 4 seconds
to.
It means that I need to fetch only some rows? OK, I've created code for
this task that looks like this:

DataTable schema_table = new DataTable();
schema_table.Columns.Add(new DataColumn("WORD",
Type.GetType("System.String")));

query = "select WORD where SOUNDEX = 2389";
FbCommand cmd = new FbCommand();
cmd.CommandText = query;
cmd.Connection = DataLayer.conn;
FbDataReader reader = cmd.ExecuteReader();

int i = 0;
while (reader.Read() && (i < _limit || _limit == -1))
{
        DataRow dr = new schema_table.NewRow();
        for(int i = 0; i < reader.FieldCount; i++)
                {
                    dr[i] = reader[i];
                }
        Similar.Add(dr["WORD"]);
        i++;
}

As you can see, my table contains three columns: ID, WORD (50 char
string), and byte SOUNDEX. I can set _limit to -1 to fetch all rows, or
set it to limit my results.

I now an interesting thing:

When I fetch all rows the time is still about 4 seconds, but...
When I fetch only 5 words (_limit set to 5) than...

OK, now everything works fine :). Thanks again for help!


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to