Efficient (PHP?) Filtering from MySQL with 3 Big tables -


I'm working on a filtering section with "large" tables and display (for selection). is.

table_1 has 710,000 records and looks like this:

  (pk) game_id param_1 param_2 param_3  

422,218,503 records in Table_2 And looks like this:

  (pk) set_id value_1 value_2  

table_3 has 56,312,204 records and looks like this:

< Pre> (pk) relation_id game_id set_id box_1 box_2

Inserts are not common (once a week), but there are selections (many, daily).
3 types of searches are common:

  1. Only by table_1 (using param_1, param_2, param_3)
  2. only to table_3
  3. A combination of both

Every search will have a maximum of 20 games, and I am worried about the 3D case, where they both for Paramer, Paramol and Price_1 in Table_1 and Table 2 Do the search. I do not want to use any selection ... because the templates are due to the size of the tables (3 table is more than 10 GB between the data).

The one I am thinking about is as follows:

Step 1: Select Set_Ad

Step 2: Select all Game_ID steps from the table 1 to WHERE set_id = value

Setp 3: Select SELECT for Table_1 WHERE game_id = Value from Step 2

Write the SQL just to join the table in the form of design, some adaptation in DB Which can be difficult to match Interpenetrated language like PHP.

If your query is slow, look at your WHERE and make sure that an index is used if it Still looks slow on joining .... From there you can ask more specific tuning questions.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -