mysql - I only want one row from my tables. Is it better to do a JOIN or just make two select calls -


I get two tables. All columns in Table 1 and only one column in Table 2 require one line. () Range 0,1;

Obtaining the row using the order; I think it is more efficient to select all the columns in Table 1, then make another call from table 2 to get that additional column. Because I only need a record, I'm worried that it is doing extra work in the background to join tables when I only need one line.

I am still developing locally and my computer is fast so I 'tell the difference', but when it goes live, payment server will have multiple calls per second, so the resource is valuable.

There is no efficiency by the RAND boundary 0,1; It will not be well on the scale. This is a design flaw outside the gate. If you insist on this, you definitely would not want to include it, because it will be again on every line in the table. At a minimum, you should choose a small sample of rows to draw some random ones:

  $ row = SELECT table_rows * contact Rand () informatics. Tablet Select Foo and Bar * Line from Foobar LIMIT $ 1,  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -