Skip to main content

How to JOIN Tables with MySQL

In this article, I will talk about the speed of the JOIN table in various forms of MySQL, which will be useful. In choosing the right command style in order to get the fastest results

The test is nothing much. I tested the functionality on phpMyAdmin and then saw the results of the query speed from phpMyAdmin. If applied to other tests, try it.

Testing, I chose the test command in the JOIN group to select all the data to be displayed. It is a query that gives the same result in 3 types without sorting.

SELECT I.*,T.*
FROM eduparty_index AS I INNER JOIN eduparty_template AS T
ORDER BY I.username

3,060 total, keywords lasted 0.1406 seconds

SELECT I.*,T.*
FROM eduparty_index AS I CROSS JOIN eduparty_template AS T
ORDER BY I.username

3,060 total, keywords lasted 0.1145 seconds

SELECT I.*,T.*
FROM eduparty_index AS I,eduparty_template AS T
ORDER BY I.username

3,060 total, keywords lasted 0.1043 seconds

The total time obtained is the average time for each order, 10 times, all with the same result. Try to choose And don't miss the small significance of these matters Which will have more effects If your system is getting bigger.

Comments

Popular posts from this blog

Changing AppServ Path Directory

Usually when we install AppServ on our machine Important instructions for installation are Use the given value in the program as the best, which will allow us to The directory that stores files on our device is "C:\AppServ\www" which, if we want to change this file store to another place Let us do as follows Go to Start Menu -> Programs -> AppServ -> Apache Configure Server -> Edit the Apache httpd.conf Configuration File. Clicking will open the file httpd.conf and edit it with NotePad. Let us use Replace to search and replace. "C:/AppServ/www" with the new directory name that we want. For example, "D:/www", every character is assigned to the new directory "D:\www" After that, save the file to the same name and then restart the Apache is complete. Now that we have a new directory that holds our files as "D:\www" as needed, let us put the index.php file into this directory. And then test by typing http://l

How to Improve W3C Rule

In general, if it is HTML , it is not difficult to make a website via W3C . Using Dreamweaver, it is already passed. If not, there is still an error. But if it's a script, you're dizzy, so you have to sit and do it yourself line by line What I would say here is Things that I often encounter img does not have an alt and without/before the end of the tag, especially in the first case. If we don't know what to put alt, they can put a blank value <img src = "xxx.jpg" alt = "" /> The script does not have a type. For example, <script language = "JavaScript" src = "js / function.js" type = "text / javascript"> </script> style, also must have type <link rel = "stylesheet" href = "style / style.css" type = "text / css" /> Some of the properties of the tag, such as align bgcolor. They are no longer used. In truth Must remove it all. If there is an error as soon as I st

Priorities Within the WHERE Statement of MySQL

Prioritization within the WHERE clause of MySQL has a profound effect on query performance, especially in the case of the database is large or complex queries, in which MySQL processes the SQL statements from left to right. The important principle of the priority of queries in this section is to specify the results that are ordered in ascending order from left query to right query. I give an example of the member database. Suppose there are 100 records in total. 50 men, 50 women and have a unique name. I want information that is male. SELECT * FROM user WHERE sex='m' I will get 50 records. If I need information called test. SELECT * FROM user WHERE username='test' I will get only one record (if any). The above command will execute a loop from the first record one by one and compare the data within the WHERE statement. Of course, it will need to process 100 cycles according to the amount of data. Suppose, if I want the data named test male, I ca