Hi Giorgi,

If this is a routine you are calling many times, I would think that keeping a connection open would be far greater improvement to your performance. If you aren't using connection pooling, you should.

Furthermore, it might be wiser to pass the connection into the routine being called to help optimize things, as well as the use of the other things people have already said regarding Preparing a query.


Kind regards,


Scott :)


giorgi giorgi wrote:
Running a recursive cte against a table with about 1600 rows from my program needs the same time so I think it's providers issue.

Here is source code:

FbCommand cmd = BuildCommand(DbCommand);

cmd.Parameters.AddWithValue("@from", From);
cmd.Parameters.AddWithValue("@to", To);
cmd.Parameters.AddWithValue("@code", Code);

try
{
  cmd.Connection.Open();
//This needs 0.028 seconds.
  return cmd.ExecuteReader(CommandBehavior.CloseConnection);
}


This code is in a separate function and is called about 2000 times.
On Tue, Sep 30, 2008 at 1:16 PM, Carliños <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hello:

        1. I changed query but ut's the same.
        2. Yes, there are ascending indexes.
        3. Not very. The file is about 3Gb and op table has about
        4,000,000 records.
        4. Executing stored procedure takes the same time. According
        to profiler it is Prepare method that takes most of the time.
        5. IBExpert 2.0 seems to run query faster but I can be mistaken.


    Coyuld you show us the code that is running the query, please ??


-- Carlos Guzmán Álvarez
    Vigo-Spain

    http://carlosga.wordpress.com

    -------------------------------------------------------------------------
    This SF.Net <http://sf.net> email is sponsored by the Moblin Your
    Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win
    great prizes
    Grand prize is a trip for two to an Open Source event anywhere in
    the world
    http://moblin-contest.org/redirect.php?banner_id=100&url=/
    <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
    _______________________________________________
    Firebird-net-provider mailing list
    Firebird-net-provider@lists.sourceforge.net
    <mailto:Firebird-net-provider@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
------------------------------------------------------------------------

_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to