zubair mirza
New member
- Local time
- Today, 16:27
- Joined
- Jul 30, 2020
- Messages
- 6
hi
i have a mobile phone database of 20+ tables of same kind data. All these tables have more then 400 million records. all 20+ tables have 5 columns, Subscriber Number, Name, Address, CNIC, and BVS. i run this code to fetch the specific record:
SELECT Telenor1.SUBNO, Telenor1.Name, Telenor1.CNIC, Telenor1.Address, Telenor1.BVS, "Telenor" AS QRYTYPE, "Telenor1" AS DBTYPE
FROM Telenor1
WHERE Telenor1.SUBNO=[Forms]![frmSearchNUM]![tbNUM]
UNION SELECT Telenor2.SUBNO, Telenor2.Name, Telenor2.CNIC, Telenor2.Address, Telenor2.BVS,"Telenor" AS QRYTYPE, "Telenor2" AS DBTYPE
FROM Telenor2
WHERE Telenor2.SUBNO=[Forms]![frmSearchNUM]![tbNUM]
and so on include all the tables like this and when i run the query, query runs fine and i get the record but it take too much time like 10 mins. if anyone can help me. how can it run fast
i have a mobile phone database of 20+ tables of same kind data. All these tables have more then 400 million records. all 20+ tables have 5 columns, Subscriber Number, Name, Address, CNIC, and BVS. i run this code to fetch the specific record:
SELECT Telenor1.SUBNO, Telenor1.Name, Telenor1.CNIC, Telenor1.Address, Telenor1.BVS, "Telenor" AS QRYTYPE, "Telenor1" AS DBTYPE
FROM Telenor1
WHERE Telenor1.SUBNO=[Forms]![frmSearchNUM]![tbNUM]
UNION SELECT Telenor2.SUBNO, Telenor2.Name, Telenor2.CNIC, Telenor2.Address, Telenor2.BVS,"Telenor" AS QRYTYPE, "Telenor2" AS DBTYPE
FROM Telenor2
WHERE Telenor2.SUBNO=[Forms]![frmSearchNUM]![tbNUM]
and so on include all the tables like this and when i run the query, query runs fine and i get the record but it take too much time like 10 mins. if anyone can help me. how can it run fast