473,320 Members | 1,939 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,320 software developers and data experts.

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 9185
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**********@yahoo.com> schreef in bericht
news:b6**************************@posting.google.c om...
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.uk> wrote in message news:<3f***********************@news.xs4all.nl>...
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**********@yahoo.com> schreef in bericht
news:b6**************************@posting.google.c om...
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
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
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...
39
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
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...
1
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...
5
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...
4
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...
29
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...
2
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.