Stored Procedure Performance

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Stored Procedure Performance

    I've got a stored procedure which is called from a VB application on
    the clients machine. This SPL takes about 2-3 seconds to run. I can
    run this SPL over and over and recieve 2-3 second results. Then all of
    sudden it will go to 40+ seconds and stay this way for 1-2 minutes. It
    will then eventually return back to the normal 2-3 seconds.
    The client has 2 databases on this instance. One a live and one a
    test. The live has no problems and does not see this issue. While
    running this on test I've ran onstat and found no exclusive locks, yet
    it just sits there. There is no one else hitting this test base other
    than myself.

    Any ideas of what to look for.

    I've put set explain with stored procedure and it revealed nothing.

    Thanks,
    Joe P
    Senior Software Engineer
    Joe Pacelli Guest

  2. Similar Questions and Discussions

    1. stored procedure help
      Hi all! I am in need of writing a few stored procedures. The first one is to create a stored procedure to recover a database from backup and the...
    2. stored procedure value
      How can I bind a stored procedure value to a page? I've executed a stored procedure and there should be two column values created...i.e. col1 and...
    3. Stored procedure?
      Stored procedure ?? -- Message posted via http://www.dotnetmonster.com
    4. Stored procedure from stored procedure
      Is it possible to create a stored procedure from a stored procedure? When I attempt this inanity, it doesn't blow up until syntax error at the...
    5. need help on a stored procedure
      I have 2 tables. table1 and table2 I do a select on table1 and join table 2 on id. I want to check newprice in table1. if it is null, I want to...
  3. #2

    Default Re: Stored Procedure Performance

    On 1 Jul 2003 09:22:16 -0700, [email]joepacelli@earthlink.net[/email] (Joe Pacelli)
    wrote:

    What are your checkpoint durations?
    >I've got a stored procedure which is called from a VB application on
    >the clients machine. This SPL takes about 2-3 seconds to run. I can
    >run this SPL over and over and recieve 2-3 second results. Then all of
    >sudden it will go to 40+ seconds and stay this way for 1-2 minutes. It
    >will then eventually return back to the normal 2-3 seconds.
    >The client has 2 databases on this instance. One a live and one a
    >test. The live has no problems and does not see this issue. While
    >running this on test I've ran onstat and found no exclusive locks, yet
    >it just sits there. There is no one else hitting this test base other
    >than myself.
    >
    >Any ideas of what to look for.
    >
    >I've put set explain with stored procedure and it revealed nothing.
    >
    >Thanks,
    >Joe P
    >Senior Software Engineer
    John Carlson Guest

  4. #3

    Default Re: Stored Procedure Performance

    Look at checkpoints [Most likely]
    Look at the 'set wait mode' and locking issues [you seemed to have
    checked]

    Set explain is only relevant when the SPL is created.

    Joe Pacelli wrote:
    >
    > I've got a stored procedure which is called from a VB application on
    > the clients machine. This SPL takes about 2-3 seconds to run. I can
    > run this SPL over and over and recieve 2-3 second results. Then all of
    > sudden it will go to 40+ seconds and stay this way for 1-2 minutes. It
    > will then eventually return back to the normal 2-3 seconds.
    > The client has 2 databases on this instance. One a live and one a
    > test. The live has no problems and does not see this issue. While
    > running this on test I've ran onstat and found no exclusive locks, yet
    > it just sits there. There is no one else hitting this test base other
    > than myself.
    >
    > Any ideas of what to look for.
    >
    > I've put set explain with stored procedure and it revealed nothing.
    >
    > Thanks,
    > Joe P
    > Senior Software Engineer
    --
    Paul Watson #
    Oninit Ltd # Growing old is mandatory
    Tel: +44 1436 672201 # Growing up is optional
    Fax: +44 1436 678693 #
    Mob: +44 7818 003457 #
    [url]www.oninit.com[/url] #
    Paul Watson Guest

  5. #4

    Default Stored Procedure Performance

    For those of you using CFMX, SQLServer and stored procedures - has anyone been
    able to quantify the performance gain of performing your queries through Stored
    Procedures versus the usual CFQuery? I understand the issue with injection
    attacks - so we don't need to cover that here today.

    My basic understanding tells me that the Stored Procedure saves alittle time
    on the database side as the SQL is already parsed and optimized by the database
    and passing in a query string via CFQuery probably needs to have that done.
    However, the main bulk ot the performance time is more related to the query
    itself, table indexes, the data in the tables, yadda yadda...

    Am I missing something or is there more to it? Also, your experiences with
    moving from an application using all CFQuery to relying on stored procedures
    would be helpful.

    Thanks

    zz3top Guest

  6. #5

    Default Re: Stored Procedure Performance

    for the real skinny on this you should probably ask on the sql server list. but
    since you asked, *these* days ms sql server's dynamic SQL probably performs
    about as well as sp do for your basic CRUD for small recordsets (you can get
    dynamic sql data path caching using built in sp to execute the sql). any logic
    beyond that or for larger recordsets you should probably be using an sp. as a
    simple example, a single sp name would be shot over the LAN to the db server vs
    gobs and gobs of dynamic sql.

    besides security there are plenty of other valid reasons for using sp. command
    and control, RAD, etc.




    PaulH Guest

  7. #6

    Default Re: Stored Procedure Performance

    We are using Cold Fusion version 5. For storing client Variables on each page
    cold fusion is using inline queries to select, insert and update the client
    variable information in Client Management database. This eats up lot of RAM on
    SQL Server as the inline queries are not properly parameterized. An example is
    (from syscacheobjects on SQL Server 2000)

    (@P1 text,@P2 char(53))UPDATE CGLOBAL SET data=@P1,lvisit={ts '2006-05-10
    09:12:56'} WHERE cfid =@P2

    As the query has not parameterized lvisit, this query is cached for each call
    where the lvisit is different. In order to optimize the RAM usage on SQL
    Server, i have two options
    1) Change this query so that lvisit is parameterized --> Not so good option
    but will be better
    2) Convert all inline queries in procedures and use stored procedures --> The
    best option.

    I would like to know, if there is any way i can change these inline queries to
    stored procedure with Cold Fusion 5?

    Jigar Patel
    Manager Database Systems
    Ticketsnow.com



    Jigar_Patel Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139