简体   繁体   中英

Data retrieval delay from resultset java

I have to get some data by joining two tables so I have make a view that contains the join and order by options. As well as I have used indexes for columns in where clause but when retrieving a data set about 150 records it delays. Normally it retrieves 12 records per second. (DB used: Oracle 11g) Could you please help me to find a optimization technique for this?

Tables:

Employee{eid,fnmae,lname,did,sal_cat,reg_id}

Departments{did,dname,dhead}

View:

CREATE OR REPLACE VIEW EmpDep AS
SELECT e.eid,e.fname,e.lname,d.dname,e.reg_id
FROM employee e, deparments d
WHERE sal_cat='A' and e.did=d.did
ORDER BY e.did,d.did;

Query in JAVA:

SELECT eid,fname,dname FROM EmpDEP
WHERE reg_id="US";

try this

CREATE OR REPLACE VIEW EmpDep AS
SELECT e.eid,e.fname,e.lname,d.dname,e.reg_id
FROM employee e INNER JOIN deparments d ON e.did=d.did
WHERE sal_cat='A' ORDER BY e.did,d.did;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM