473,782 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL optimizations in Oracle

consider the following queries that deals with report pagination

a ) select MYROWS.* from
(select * from TABLE_NAME) MY_ROWS where rownum between 1 and 100

b) select * from TABLE_NAME where rownum between 1 and 100

My question : Does oracle optimize the first query so that it is not
significantly different (on execution time) when compared to the
second query ?

Thanks

Rishi
Jul 19 '05 #1
2 4900
First off, you can't possibly be using this for report pagination.
Because your queries, as they are without any valid ORDER BY clause,
will not accomplish your goal. ROWNUM being only a pseudo-column will
not guarantee the same set of rows in between calls. Maybe rethink
that a bit.

Re: your question on query optimization, maybe see the plans for
yourself. "SET AUTOT TRACE EXP" in SQLPLUS to get you started.

HTH.

v_*******@yahoo .com (Rishi Kumar) wrote in message news:<fd******* *************** ****@posting.go ogle.com>...
consider the following queries that deals with report pagination

a ) select MYROWS.* from
(select * from TABLE_NAME) MY_ROWS where rownum between 1 and 100

b) select * from TABLE_NAME where rownum between 1 and 100

My question : Does oracle optimize the first query so that it is not
significantly different (on execution time) when compared to the
second query ?

Thanks

Rishi

Jul 19 '05 #2
I had a previous post on this thread which was mildly out of whack.
What was I thinking!?

Your queries using ROWNUM will not work for your pagination purposes.
Period.
You cannot get "page 2" by saying "select ... from ... where rownum
between 101 and 200".

Cheers.

v_*******@yahoo .com (Rishi Kumar) wrote in message news:<fd******* *************** ****@posting.go ogle.com>...
consider the following queries that deals with report pagination

a ) select MYROWS.* from
(select * from TABLE_NAME) MY_ROWS where rownum between 1 and 100

b) select * from TABLE_NAME where rownum between 1 and 100

My question : Does oracle optimize the first query so that it is not
significantly different (on execution time) when compared to the
second query ?

Thanks

Rishi

Jul 19 '05 #3

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

Similar topics

3
2230
by: Murat Tasan | last post by:
i asked something about java optimization before, but i gave a very poor example... leading to not much help... so here is a better situation. i have a Map, and i'm constantly picking entries from random from this map. in one method, i only use the map. in another method, i use an array of keys from the map, stored seperately. method a (only the map):
1
1316
by: VM | last post by:
Does Studio Dot Net include any optimizations that make it the appropriate tool for Pentium 4 processors? I'm writing a paper on compiler optimizations for modern hardware. Since I chose .Net as my main tool, I was looking for some sites that explain some of the optimizations .Net may have that will make it more compatible with modern hardware. I'm also looking for info on the differences between traditional compilers and the Dot Net...
2
1084
by: Patrick Stinson | last post by:
I've added an extra thread to my application read from an alsa midi device, and when I compile with any optimizations (gcc -O3 or gcc -O2) the application "freezes" (meaning I don't know what code is still executing) after the last of my threads (I have three, including the main thread). This does not happen w/o optimizations. Cheers
1
1656
by: VM | last post by:
Hello, I'm looking for information on C# compiler optimization or compilation for an engineering short paper I want to write. Any sites with some technical info on the new advances of C# compilation would be greatly appreciated. Any sites that have comparisons between C# compilation an any other language would be even better. My email is : MYERSV at GO dot COM
1
1656
by: Hareth | last post by:
VS2003: In the properties of the solution, their is a checkbox that lets you "enable optimizations". What are the pos & the neg?
9
3439
by: Edmund Dengler | last post by:
Greetings! Just trying some tests out, and wanted to know about some optimizations. If I do a CHECK constraint on a table, is this used to optimize a SELECT or does Postgresql rely mostly on normal index search? For example, I want to create some tables to manage different data in a kind of <object, relationship, object2> manner, but where object2 could be an IP address, text, a number, etc. So I thought of doing the following:
29
1927
by: sammy | last post by:
Word up! If there are any gcc users here, maybe you could help me out. I have a program and I've tried compiling it with -O2 and -O3 optimization settings. The wired thing is that it actually runs faster with -O2 than with -O3, even though -O3 is a higher optimization setting. Have I found a bug in gcc? Could I be doing something wrong?
1
359
by: Rishi Kumar | last post by:
consider the following queries that deals with report pagination a ) select MYROWS.* from (select * from TABLE_NAME) MY_ROWS where rownum between 1 and 100 b) select * from TABLE_NAME where rownum between 1 and 100 My question : Does oracle optimize the first query so that it is not significantly different (on execution time) when compared to the second query ?
0
1111
by: tmh | last post by:
C++ optimizations (general) http://tmh-coding-tips.blogspot.com/2008/09/cc-c-optimizations-general.html C++ optimizations for initialization http://tmh-coding-tips.blogspot.com/2008/09/cc-c-optimizations-for-initialization.html C++ optimizations for loops, if/else and switch/case statements http://tmh-coding-tips.blogspot.com/2008/09/cc-c-optimizations-for-loops-ifelse-and.html C/C++ Tutorials
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.