PDA

View Full Version : MySQL speed and Relations between tables


Intec
Wed 22nd Nov '00, 6:37am
In the whole vbb and in another php-software I dont see many relation between tables - I see mostly querys about one table and then the software take a result and go with it to the next query.

Had MySQL a performance problem?

In vbb - i take the postid from the thread-table (for the last posting f.i.) then i go into post-table and take there pagetext. And I go to the forum-table with the forumid from the thread-table and take the forum-name.

All that can man put in one query with relations through various tables.

Why doesnt do this so in MySQL?

Intec
Thu 23rd Nov '00, 9:05am
15 views and zero man - or woman - has a idea?

Chris Schreiber
Mon 27th Nov '00, 3:20pm
Originally posted by Intec
All that can man put in one query with relations through various tables.

Yes, you can do this with a 'join' between the tables:
SELECT fields FROM thread, post WHERE post.postid=thread.postid

This is typically alot more efficent the having two queries for the above statement, especially if the second query is within some kind of loop.

-Chris

Intec
Mon 27th Nov '00, 5:28pm
Yes, I know this but no one programmers use this for php/mysql. They make two queries.

Because of that i think, that this is a mysql-perfomance problem.

Intec
Fri 26th Jan '01, 6:42am
Because of that i think, that this is a mysql-perfomance problem.

Is that?

Freddie Bingham
Fri 26th Jan '01, 12:02pm
Originally posted by Intec
Yes, I know this but no one programmers use this for php/mysql. They make two queries.

Because of that i think, that this is a mysql-perfomance problem.

vb 1.1.4+ and vb2.0 have many queries involving JOINs.