Efficient Query, Table Bridge/indexing And Strucuture
Solution 1:
Here's a start:
select *
from
schedule
inner join semester
on schedule.semester_id = semester.id
inner join office_hours
on office_hours.id = schedule.???
It's not clear how office_hours correlates with schedule?
Solution 2:
'queries to be executed quickly enough'
INSERT or SELECT?
If you want your INSERT/UPDATE to be fast, normalise it to the nth degree
If you want your SELECT to be fast, denormalise it (which of course makes INSERT's UPDATE's complicated and slow)
If your main table (schedule?) has < 10,000 records and it's a decent RDBMS then it's probably running as fast as it can.
Normally the performance tuning process involves
- Identifying a workload (what queries do I usually run)
- Getting a baseline (how long do they take to run)
- Tuning (adding indexes, changing design)
- Repeat
So we would really need to have an idea of what kind of queries are performing slowly, or alternatively what kind of growth you expect in which tables.
I'm not sure what you mean by 'bridge results'. What happens when you buidl a query that joins the tables as per the physical diagram? an error or unexpected ersults?
Post a Comment for "Efficient Query, Table Bridge/indexing And Strucuture"