Fetching Data From View takes too much time in Application - view

I Created a view by joining multiple Tables and also Uses a SubQuery.
and all the columns from view are mapped to Aplication
In a view only 1000 Rows are there and it takes 2 min to run
Issue:
In Application it takes 40 to 50 sec to fetch data from the View
Is the Database Issue or Network related issue please suggest me

Related

Design change to switch from Oracle Materialized view to simple view

We are using Oracle Materialized view to extract data for a reporting system. The setting of the MV is to refresh on every commit.
After migrating to Oracle 19 form Oracle 12 system was very slow for few days and eventually became unresponsive after few days due to various bugs in Oracle 19 related to Materialized View.
We did a workaround of changing MV setting from on commit to OnDemand every 5 min to solve this issue.
The parent table on which this view is created gets updated every second and has 2 million records.
Having a MV on a table which is updated so frequently is fundamentally not a good design.
We don't want to depend on Oracle patches to fix this and planning to redesign this table.
Can I change this view to simple view and possibly apply all possible ways to improve query response time and expect that I will have view query returned in few seconds given I have 2 mil records in Parent table.
Assume that table has basic datatypes only and view is reading about 5-6 fields.
We tried oncommit to ondemand as a workaround but as per the business need, we need committed data for the reporting system and cannot be delayed more than one min.

Performance part in oracle

I have two different users however one user is taking more than 2 mins to get the results from the view and have only 47 records and second in taking 0.48 sec to get the records from the same view and have records in thousands. How is this possible? Both are running in same view, same environment. Please guide what steps need to be follow to get this analysis done.

What effect have the number of records of a particular table (in SQL Server) on LINQ Queries response time in C# MVC

I made some googling about my subject title, but didn't find useful answer. Most question were about effect of number of table's columns on query performance, while i need to know the effect of number of table's rows on linq query response time in C# MVC project. Actually, i have a web MVC project in which i try to get alarms set using ajax call from server and show them in a web grid in client side. Each ajax call is performed every 60 seconds in a loop created with setTimeOut method. Number of rows are gradually increasing within the alarm table (in SQL Server Database) and after a week, it reaches to thousands of rows. At first when lunching the project, I can see in DevTools of browser(Chrome), the time each ajax call takes is about 1 second or so. But this time gradually increases every day and after a week each success ajax call takes more than 2 minutes. This causes about 5 ajax call always be in pending queue. I am sure there is no memory leak both in client(JQuery) and server(C#) sides code, So the only culprit I suspect is SELECT Query response time performed on alarm table. I appreciate any advice.
Check the query that is executed in the database. There are two options:
Your Linq query fetches all the data from the database and process them locally. In this case the number of rows in the table is quite important. You need to fix your Linq query and make sure it fetches only the relevant rows from the database. Then you can hit option 2.
Your Linq query fetches only the relevant rows from the database, but there are no relevant indexes in your table and each query scans all the data in the table.
However with only few thousands rows in your table, I have doubts it will take 2 minutes to scan the table, so option 1 is more likely to be the reason for this slowdown.

fetch 200k records in single jpa select query within 5 seconds

I want to fetch 200k records in single jpa select query within 5 seconds. I am selecting one column which is already indexed. Currently It is taking more than 5 minutes. is it possible to select over 100k of records in 5 seconds?
This is not possible with hibernate or normal native query since it has to create hundreds of thousands of objects in java side and results needs to be sent over the network (Serialization & de-serialization).
You could do below steps for fine tuning,
At DB side you could change the index method default is binery tree instead set it as "HASH" method.
Use Parallel threads to retrieve the results in paginated mode (Use native SQL).
Hope it gives some inputs for further fine tuning.
Use this property to retrieve lakh of records.
query.setHint(org.hibernate.fetchSize, 5000);

how to control refresh interval to oracle views

I am creating an oracle view basically as a read-only summary of data from other tables. It is not necessary to update the view every time if there is any updates to associated tables otherwise the workload will be huge and a waste. It is better to refresh the view every 5 minutes and then the front end can receive the latest data that will be all.
However, how to setup the oracle view refreshing interval? Do we have to settle this constraints in PL/SQL?

Resources