My Business
6.3K members online now
6.3K members online now
Follow threads that discuss the latest tips on how to get your business online… for free!
Guide Me
star_border
Reply

relational mysql

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

i work with mysql and have a DB with multiple tables for relational reasons. Can i create relations and use multiple tables to get the fields i need for a report?

relational mysql

Participant ✭ ✭ ✭
# 2
Participant ✭ ✭ ✭

You are in the wrong place.

Yes. You can 'join' tables together using common fields. They do not need to be indexed fields but it can be a slow result if not.

You may need to create temporary result tables to use in a following Join to speed things up.

 

I solved a problem for a IBM client by 10.30 but I knew the simple SQL query would run forever. It took a few days to write and save result tables to get a result which ran in a reasonable time.

 

Part of good database design is to get the right relational analysis so that joining tables works efficiently.

 

There are different types of Join, follow on, star and so on. The order you do these in will affect run times. Start with the most restrictive result first and which will use pre-set indexes as a result.

 

I had a programmer at Jaguar Cars who ignored some fields in the program specification pseudo-SQL I used to write in for performance reasons. His cut down version took 3 minutes to run. When I got him to program as specified it took 3 seconds. Inside the SQL system there is am Optimiser. Fortunatlely at Jaguar our IBM System Engineer liked me and he gave me a copy of their SQL performance notes. He also got me an intrview with a mate at IBM. No result though. I would not have met any managers 'baby sitting on demand requirement'.

 

Hope that helps.