简体   繁体   中英

Best approach for my requirements

I have tables table 'A' and table 'B' table 'c' Table A


Aid AC1 AC2


1 23.34

Table B


Bid BC1 BC2


1 34.56

Table C


Cid CC1 CC2


1

AC2 and BC2 are derived values and always changes. CC1 is sum (AC1)*AC2 and CC2 = Sum (BC1)*BC2 In my UI I need show these calculated values from all these tables. If the user likes to save I need to lock the values and save AC2, BC2, CC1, CC2.we are planning to use views for this but views are really slow. What is the alternative approach?

You just need to use indices, then you will get faster views. Every column that appears in a group by statement, order by statement or in a condition makes views faster when indexed. If you have expressions like: select ... where A=... group by B order by C

Then you'd better make A, B and C indices

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