Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > BOOK: Beginning ASP.NET Databases
|
BOOK: Beginning ASP.NET Databases Also see the forum ASP Databases for more general discussions of ASP database issues not directly related to these books.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 23rd, 2003, 10:37 AM
Registered User
 
Join Date: Dec 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Complied Version of Statement (Preapared=True)

Hello,

I have a small .NET application. I use bind variables all overe my
application. But my parse:execute ratio is 1 for all of my SELECT
statements. There are many softparses in my application. I have also set session_cached_cursors.

DB Version 9.2.0
OS NT
Provider: OraOLEDB 9.2.0.1.0

While using ADODB command object I set the "Prepared" parameter to true. But
even though
there are many parses.

Heres is the simple block of code ..

strCmd = "SELECT DISTINCT TO_CHAR(exp_date,'Month') Months, " _
TO_CHAR(exp_date,'MM') MM FROM expenses ORDER BY MM"

cmd1 = New ADODB.Command()
cmd1.ActiveConnection = cConn
cmd1.CommandText = strCmd

cmd2 = New ADODB.Command()
cmd2.ActiveConnection = cConn
cmd2.CommandText = strCmd
cmd2.Prepared = True

For intLoop = 1 To 4
cmd1.Execute()
Next intLoop

For intLoop = 1 To 4
cmd2.Execute()
Next intLoop


Heres the tkprof trace output

################################################## ##############################
SELECT DISTINCT TO_CHAR(exp_date,'Month') Months, TO_CHAR(exp_date,'MM') MM
FROM
expenses ORDER BY MM

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ----------
----------
Parse 8 0.00 0.00 0 0 0 0
Execute 8 0.04 0.06 0 0 0 0
Fetch 8 0.01 0.01 0 56 0 226
------- ------ -------- ---------- ---------- ---------- ----------
----------
total 24 0.06 0.07 0 56 0 226

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 62

Rows Row Source Operation
------- ---------------------------------------------------
23 SORT ORDER BY
23 TABLE ACCESS FULL EXPENSES

################################################## ##############################

Logically it should be one parse and 8 execution. Will anybody please
suggest me, how do I minimise the number of parses?

Thanks in advance

Sameer






Similar Threads
Thread Thread Starter Forum Replies Last Post
Passwords from version 1 to version 2 Maxxim BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 February 6th, 2007 06:49 PM
SmartNavigation="true" CraigJones ASP.NET 1.0 and 1.1 Basics 2 September 3rd, 2004 01:29 PM
True DBGrid 8.0 KalluMama Pro VB 6 1 August 10th, 2004 01:39 AM
Stupid but true Adam H-W SQL Server 2000 3 December 6th, 2003 12:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.