473,804 Members | 3,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the efficient way to select data from huge database?

Hi experts of Oracle,

I used Oracle for small queries, but now I have a task to create
WEB-based report by getting data, summarying ( several counts, min and
max) and re-formatting, where the data are from around 10 tables, each
of them is > 10k records, some larger ones have > 1 million records.
Using sql*plus to count all records in a table took 25 seconds

Since it is web-based, the number one concern for me is speed. Hope
you Oracle gurus can give me some hints how to do it?
The following is what I can think about:
1. Create a single complex query with all summary data (group by some
big categories); OR
2. Create some intermediate tables to keep data I need by running
several queries each night, and the application uses them when user
run application.
3. Can stored procedure do any help in improving speed here?
4. Can materilized view do any help for such case?
5. which is faster, many small queries to get data OR 1/2 big queries?

Thanks
Jul 19 '05 #1
2 9221
Hi Henry,

To answer your questions as far as I can at this moment:

1. Let the optimizer do it's work, 1 complex query should be okay as long as
you analyze all tables excluding owned by SYS.

1/2. Where you might look into in this case is materialized views, this is
the appropriate way for getting better response times.

3. I do not see what stored procedures could do. If you can do it in a plain
SQL statement, do it in a plain SQL statement.

4. Yes

5. Let the optimizer do it's work. Size your database properly and 1 big
query should be okay. Splitting up is more something you use when your bound
in some sort of way or when you are using database types that are less
scalable to handle such a huge amount of data.

Extra comment: What I see from the amount of records is that it is all quite
small, it depends on the right use of indexes, analyzing tables and
datamodel to get good response in all cases.

When the data grows over time, you may want to investigate in a year or
something to use partitioning.

HTH,

--
Jasper Scholten
DBA / Application Manager / Systems Engineer

"Henry" <we**********@y ahoo.com> schreef in bericht
news:b6******** *************** ***@posting.goo gle.com...
Hi experts of Oracle,

I used Oracle for small queries, but now I have a task to create
WEB-based report by getting data, summarying ( several counts, min and
max) and re-formatting, where the data are from around 10 tables, each
of them is > 10k records, some larger ones have > 1 million records.
Using sql*plus to count all records in a table took 25 seconds

Since it is web-based, the number one concern for me is speed. Hope
you Oracle gurus can give me some hints how to do it?
The following is what I can think about:
1. Create a single complex query with all summary data (group by some
big categories); OR
2. Create some intermediate tables to keep data I need by running
several queries each night, and the application uses them when user
run application.
3. Can stored procedure do any help in improving speed here?
4. Can materilized view do any help for such case?
5. which is faster, many small queries to get data OR 1/2 big queries?

Thanks

Jul 19 '05 #2
Thanks. I will try.
"Jasper Scholten" <ja*******@NO-SPAM.yahoo.co.u k> wrote in message news:<3f******* *************** *@news.xs4all.n l>...
Hi Henry,

To answer your questions as far as I can at this moment:

1. Let the optimizer do it's work, 1 complex query should be okay as long as
you analyze all tables excluding owned by SYS.

1/2. Where you might look into in this case is materialized views, this is
the appropriate way for getting better response times.

3. I do not see what stored procedures could do. If you can do it in a plain
SQL statement, do it in a plain SQL statement.

4. Yes

5. Let the optimizer do it's work. Size your database properly and 1 big
query should be okay. Splitting up is more something you use when your bound
in some sort of way or when you are using database types that are less
scalable to handle such a huge amount of data.

Extra comment: What I see from the amount of records is that it is all quite
small, it depends on the right use of indexes, analyzing tables and
datamodel to get good response in all cases.

When the data grows over time, you may want to investigate in a year or
something to use partitioning.

HTH,

--
Jasper Scholten
DBA / Application Manager / Systems Engineer

"Henry" <we**********@y ahoo.com> schreef in bericht
news:b6******** *************** ***@posting.goo gle.com...
Hi experts of Oracle,

I used Oracle for small queries, but now I have a task to create
WEB-based report by getting data, summarying ( several counts, min and
max) and re-formatting, where the data are from around 10 tables, each
of them is > 10k records, some larger ones have > 1 million records.
Using sql*plus to count all records in a table took 25 seconds

Since it is web-based, the number one concern for me is speed. Hope
you Oracle gurus can give me some hints how to do it?
The following is what I can think about:
1. Create a single complex query with all summary data (group by some
big categories); OR
2. Create some intermediate tables to keep data I need by running
several queries each night, and the application uses them when user
run application.
3. Can stored procedure do any help in improving speed here?
4. Can materilized view do any help for such case?
5. which is faster, many small queries to get data OR 1/2 big queries?

Thanks

Jul 19 '05 #3

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

Similar topics

13
5063
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
7
2121
by: lawrence k | last post by:
Okay, I just backed up my database, just in case. The whole schema for the database is here: http://www.accumulist.com/index.php?whatPage=db.php You can run any SELECT query against this database that you want, and send it as a GET request. This would be an example: http://www.accumulist.com/output.php?whatPage=showSqlQuery&sql=select%20id,%20headline,%20tagCloud.private%20from%20tagCloud
39
3237
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
3
3493
by: Gummy | last post by:
Hello, I have an ASPX page on which I place a UserControl 15 times (they only need to be static controls on the page). This UserControl is a set of two listboxes with radiobuttons above the listbox (to select between viewing a code or description in the listbox). There are also left and right arrows that move the selected items between the listboxes. In my Page_Load I assign each UserControl the appropriate DataTable and this...
1
5742
by: Maxwell2006 | last post by:
Hi, I am working with strongly typed datatables. What is the most efficient way to build a new DataTAble based on the result of DataTable.Select? At this point I use a foreach loop to do the work manually. I am looking for an automated way. Thank you, Max
5
3690
by: sql_er | last post by:
Guys, I have an XML file which is 233MB in size. It was created by loading 6 tables from an sql server database into a dataset object and then writing out the contents from this dataset into an XML file. Once my application starts, I load this XML file into a DataSet object using "ReadXML" function. This creates a dataset in memory with 6 tables.
4
2061
by: Amar | last post by:
Hi All, I need to select data from a database table containing huge amount of data. Now I am storing data using one primary key and I am just using simple select statement, and this process gives me the output but it is taking long to execute the query. As much I had heared I want to use some indexing or cluster indexing which might help me but I am not so familiar with these things. So if any one having some solutions to execute the...
29
2349
by: calvert4rent | last post by:
I need to some sort of data type that will hold a listing of ID's and their counts/frequency. As I do some processing I get an ID back which I need to store and keep an accurate count for how many times that ID is listed. For example I might get a listing of these numbers: 1,4,6,23,6,2,54,1,6,23,2,4,1,6 I will get those numbers one at a time and need to build something like 1,3
2
272
by: Henry | last post by:
Hi experts of Oracle, I used Oracle for small queries, but now I have a task to create WEB-based report by getting data, summarying ( several counts, min and max) and re-formatting, where the data are from around 10 tables, each of them is 10k records, some larger ones have 1 million records. Using sql*plus to count all records in a table took 25 seconds Since it is web-based, the number one concern for me is speed. Hope you Oracle...
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9577
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
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
9140
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...
0
6847
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();...
1
4295
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
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.