473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Page Processing Efficiency

If I had a page that was being generated using coldfusion from queries
to an oracle table would it be better response time:
A) pulling the all the data using 1 query and iterating over the same
result table multiple time producing desired arrays, or
B) pulling specific data using specific queries with less production of
arrays and proccessing after te data was returned?

In the example I had 2 date fields called start and comp in a table with
other like data and wanted to know what the min value was from both
fields.

So I have to "select * from the table where mynum='131'" and then
process the result set

or

"select * from the table where mynum='131'" as well as 2 more queries:

"SELECT min(min_start) as min_start
FROM
(
SELECT min(BASE_START) as min_start
FROM TASK
WHERE my_NUM = '131'
UNION
SELECT min(ACT_START) as min_start
FROM TASK
WHERE my_NUM = '131'
)"

and

" SELECT max(max_comp) as max_comp
FROM
(
SELECT max(BASE_COMP) as max_comp
FROM TASK
WHERE my_NUM = '131'
UNION
SELECT max(ACT_COMP) as max_comp
FROM TASK
WHERE my_NUM = '131'
)
"

Jul 19 '05 #1
5 2923
use bind variables. Lot of cold fusion folks don't and it hurts their
scalability. Cold Fusion does support it.
Jim
"Michael Hill" <hi****@ram.lmtas.lmco.com> wrote in message
news:3F***************@ram.lmtas.lmco.com...
If I had a page that was being generated using coldfusion from queries
to an oracle table would it be better response time:
A) pulling the all the data using 1 query and iterating over the same
result table multiple time producing desired arrays, or
B) pulling specific data using specific queries with less production of
arrays and proccessing after te data was returned?

In the example I had 2 date fields called start and comp in a table with
other like data and wanted to know what the min value was from both
fields.

So I have to "select * from the table where mynum='131'" and then
process the result set

or

"select * from the table where mynum='131'" as well as 2 more queries:

"SELECT min(min_start) as min_start
FROM
(
SELECT min(BASE_START) as min_start
FROM TASK
WHERE my_NUM = '131'
UNION
SELECT min(ACT_START) as min_start
FROM TASK
WHERE my_NUM = '131'
)"

and

" SELECT max(max_comp) as max_comp
FROM
(
SELECT max(BASE_COMP) as max_comp
FROM TASK
WHERE my_NUM = '131'
UNION
SELECT max(ACT_COMP) as max_comp
FROM TASK
WHERE my_NUM = '131'
)
"

Jul 19 '05 #2
Jim,

Can you elaborate with a simple example?

Mike

Jim Kennedy wrote:
use bind variables. Lot of cold fusion folks don't and it hurts their
scalability. Cold Fusion does support it.
Jim
"Michael Hill" <hi****@ram.lmtas.lmco.com> wrote in message
news:3F***************@ram.lmtas.lmco.com...
If I had a page that was being generated using coldfusion from queries
to an oracle table would it be better response time:
A) pulling the all the data using 1 query and iterating over the same
result table multiple time producing desired arrays, or
B) pulling specific data using specific queries with less production of
arrays and proccessing after te data was returned?

In the example I had 2 date fields called start and comp in a table with
other like data and wanted to know what the min value was from both
fields.

So I have to "select * from the table where mynum='131'" and then
process the result set

or

"select * from the table where mynum='131'" as well as 2 more queries:

"SELECT min(min_start) as min_start
FROM
(
SELECT min(BASE_START) as min_start
FROM TASK
WHERE my_NUM = '131'
UNION
SELECT min(ACT_START) as min_start
FROM TASK
WHERE my_NUM = '131'
)"

and

" SELECT max(max_comp) as max_comp
FROM
(
SELECT max(BASE_COMP) as max_comp
FROM TASK
WHERE my_NUM = '131'
UNION
SELECT max(ACT_COMP) as max_comp
FROM TASK
WHERE my_NUM = '131'
)
"


Jul 19 '05 #3
It should be on the documentation. I don't have cold fusion docs. We are
talking about parameterized queries.
Jim
"Michael Hill" <hi****@ram.lmtas.lmco.com> wrote in message
news:3F***************@ram.lmtas.lmco.com...
Jim,

Can you elaborate with a simple example?

Mike

Jim Kennedy wrote:
use bind variables. Lot of cold fusion folks don't and it hurts their
scalability. Cold Fusion does support it.
Jim
"Michael Hill" <hi****@ram.lmtas.lmco.com> wrote in message
news:3F***************@ram.lmtas.lmco.com...
If I had a page that was being generated using coldfusion from queries
to an oracle table would it be better response time:
A) pulling the all the data using 1 query and iterating over the same
result table multiple time producing desired arrays, or
B) pulling specific data using specific queries with less production of arrays and proccessing after te data was returned?

In the example I had 2 date fields called start and comp in a table with other like data and wanted to know what the min value was from both
fields.

So I have to "select * from the table where mynum='131'" and then
process the result set

or

"select * from the table where mynum='131'" as well as 2 more queries:

"SELECT min(min_start) as min_start
FROM
(
SELECT min(BASE_START) as min_start
FROM TASK
WHERE my_NUM = '131'
UNION
SELECT min(ACT_START) as min_start
FROM TASK
WHERE my_NUM = '131'
)"

and

" SELECT max(max_comp) as max_comp
FROM
(
SELECT max(BASE_COMP) as max_comp
FROM TASK
WHERE my_NUM = '131'
UNION
SELECT max(ACT_COMP) as max_comp
FROM TASK
WHERE my_NUM = '131'
)
"

Jul 19 '05 #4
So after returning say 150 rows of data from a single query I can further query
the results of the returned rows?

Mike

Jim Kennedy wrote:
It should be on the documentation. I don't have cold fusion docs. We are
talking about parameterized queries.
Jim
"Michael Hill" <hi****@ram.lmtas.lmco.com> wrote in message
news:3F***************@ram.lmtas.lmco.com...
Jim,

Can you elaborate with a simple example?

Mike

Jim Kennedy wrote:
use bind variables. Lot of cold fusion folks don't and it hurts their
scalability. Cold Fusion does support it.
Jim
"Michael Hill" <hi****@ram.lmtas.lmco.com> wrote in message
news:3F***************@ram.lmtas.lmco.com...
> If I had a page that was being generated using coldfusion from queries
> to an oracle table would it be better response time:
> A) pulling the all the data using 1 query and iterating over the same
> result table multiple time producing desired arrays, or
> B) pulling specific data using specific queries with less production of > arrays and proccessing after te data was returned?
>
> In the example I had 2 date fields called start and comp in a table with > other like data and wanted to know what the min value was from both
> fields.
>
> So I have to "select * from the table where mynum='131'" and then
> process the result set
>
> or
>
> "select * from the table where mynum='131'" as well as 2 more queries:
>
> "SELECT min(min_start) as min_start
> FROM
> (
> SELECT min(BASE_START) as min_start
> FROM TASK
> WHERE my_NUM = '131'
> UNION
> SELECT min(ACT_START) as min_start
> FROM TASK
> WHERE my_NUM = '131'
> )"
>
> and
>
> " SELECT max(max_comp) as max_comp
> FROM
> (
> SELECT max(BASE_COMP) as max_comp
> FROM TASK
> WHERE my_NUM = '131'
> UNION
> SELECT max(ACT_COMP) as max_comp
> FROM TASK
> WHERE my_NUM = '131'
> )
> "
>


Jul 19 '05 #5
Look up parameterized queries or host variables in your documentation. You
aren't using them and you should if you want to scale well. A query with
bind variables will avoid the reparsing that dynamic sql has and hence you
will get better performance and scalability. (less latching, less CPU
usage).
eg select col1, col2, col3 from mytable where col1=?
Jim
"Michael Hill" <hi****@ram.lmtas.lmco.com> wrote in message
news:3F**************@ram.lmtas.lmco.com...
So after returning say 150 rows of data from a single query I can further query the results of the returned rows?

Mike

Jim Kennedy wrote:
It should be on the documentation. I don't have cold fusion docs. We are talking about parameterized queries.
Jim
"Michael Hill" <hi****@ram.lmtas.lmco.com> wrote in message
news:3F***************@ram.lmtas.lmco.com...
Jim,

Can you elaborate with a simple example?

Mike

Jim Kennedy wrote:

> use bind variables. Lot of cold fusion folks don't and it hurts their > scalability. Cold Fusion does support it.
> Jim
> "Michael Hill" <hi****@ram.lmtas.lmco.com> wrote in message
> news:3F***************@ram.lmtas.lmco.com...
> > If I had a page that was being generated using coldfusion from queries > > to an oracle table would it be better response time:
> > A) pulling the all the data using 1 query and iterating over the same > > result table multiple time producing desired arrays, or
> > B) pulling specific data using specific queries with less production
of
> > arrays and proccessing after te data was returned?
> >
> > In the example I had 2 date fields called start and comp in a
table with
> > other like data and wanted to know what the min value was from

both > > fields.
> >
> > So I have to "select * from the table where mynum='131'" and then
> > process the result set
> >
> > or
> >
> > "select * from the table where mynum='131'" as well as 2 more queries: > >
> > "SELECT min(min_start) as min_start
> > FROM
> > (
> > SELECT min(BASE_START) as min_start
> > FROM TASK
> > WHERE my_NUM = '131'
> > UNION
> > SELECT min(ACT_START) as min_start
> > FROM TASK
> > WHERE my_NUM = '131'
> > )"
> >
> > and
> >
> > " SELECT max(max_comp) as max_comp
> > FROM
> > (
> > SELECT max(BASE_COMP) as max_comp
> > FROM TASK
> > WHERE my_NUM = '131'
> > UNION
> > SELECT max(ACT_COMP) as max_comp
> > FROM TASK
> > WHERE my_NUM = '131'
> > )
> > "
> >

Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eric Linders | last post by:
Hello, I have a Web form that is filled out on my company's web site. When the submit button is pressed, the form data is posted to a PHP page that (in the background) inserts their information...
6
by: bissatch | last post by:
Hi, I have been tryin to run free dhtml code from a web page. The web page is: http://dynamicdrive.com/dynamicindex14/pixelate.htm When I load the page above it opens as normal and the...
7
by: A Causal | last post by:
I'm an experienced C programmer, but I have never worked with any sort of internet programming. I would like to write a program to search for certain character strings in a currently displayed web...
9
by: Arnold | last post by:
I need to read a binary file and store it into a buffer in memory (system has large amount of RAM, 2GB+) then pass it to a function. The function accepts input as 32 bit unsigned longs (DWORD). I...
4
by: Vinay Agarwal | last post by:
Hello, I would like to maximize efficiency of string processing in my C# application that works with Skype API. Actually, these "strings" are made of "chars" that are all 8-bit values except 0...
4
by: Jeremy Holt | last post by:
Hi, In a windows.forms application I would BeginInvoke a delegate on the UI thread to collect data from a database. When the call returns to the AsyncCallback, if the Control.InvokeRequired =...
4
by: Alexis Gallagher | last post by:
(I tried to post this yesterday but I think my ISP ate it. Apologies if this is a double-post.) Is it possible to do very fast string processing in python? My bioinformatics application needs to...
3
by: thomas.porschberg | last post by:
Hi, I want to read records from a database and export it in an arbitrary format. My idea was to feed a class with a String array fetched from the database and let this class fire SAX events as...
5
by: Michael Hill | last post by:
If I had a page that was being generated using coldfusion from queries to an oracle table would it be better response time: A) pulling the all the data using 1 query and iterating over the same...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.