Yes, it's not a bad practice in those situations.  One thing to note is that
in order to keep the results consistent across recordset pages, add an ORDER
BY clause that orders by the same column used in the TOP clause.

~Simon

Simon Horwith
CTO, Etrilogy Ltd.
Member of Team Macromedia
Macromedia Certified Instructor
Certified Advanced ColdFusion MX Developer
Certified Flash MX Developer
CFDJList - List Administrator
http://www.how2cf.com/


-----Original Message-----
From: Kevin Faulkner [mailto:[EMAIL PROTECTED]
Sent: 15 August 2003 10:52
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] <cfquery maxrows="x"> question


I know it's not compatible with all DBs, but "select top X * from" and then
your query will only return the number of rows. I haven't done any analysis
into the SQL performance of using TOP, but I'd guess it would be better than
CF holding all 40,000 rows and only using a small number of them?


-----Original Message-----
From: Aidan Whitehall [mailto:[EMAIL PROTECTED]
Sent: 15 August 2003 10:39
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] <cfquery maxrows="x"> question


> With the maxrows="x" argument of cfquery, does the number of retruned
> rows get limited when the query goes ahead

AFAICT, it's just an output restriction.

Doing a select *, adding maxrows="10" and viewing the SQL submitted to
the database in Oracle Enterprise Manager certainly makes it look this
way.


--
Aidan Whitehall <mailto:[EMAIL PROTECTED]>
Macromedia ColdFusion Developer
Fairbanks Environmental Ltd  +44 (0)1695 51775
Queen's Awards Winner 2003 <http://www.fairbanks.co.uk/go/awards>

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]
DISCLAIMER: This e-mail is confidential and may also be legally privileged.
If you are not the intended recipient, use of the information contained in
this e-mail (including disclosure, copying or distribution) is prohibited
and may be unlawful.  Please inform the sender and delete the message
immediately from your system.  This e-mail is attributed to the sender and
may not necessarily reflect the views of the Patsystems Group and no member
of the Patsystems Group accepts any liability for any action taken in
reliance on the contents of this e-mail (other than where it has a legal or
regulatory obligation to do so) or for the consequences of any computer
viruses which may have been transmitted by this e-mail. The Patsystems Group
comprises Patsystems plc and its subsidiary group of companies.

--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]






-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to