azzazzello
Technical User
Probably most people know this, but if someone doesn't this can be very helpful.
Whenever you are doing a JOIN or nested selects, create an INDEX on the field which you are using to crossreference. Even with a few rows, it speeds up the query TREMENDOUSLY. I have 2 tables, one of which had 1000 rows, and the other 3000. A subselect or a JOIN between them took me 58 seconds (and I expect that to increase greatly as more records are added). When I created an index on the field I was using to join them, the query time went down to 0.17 of a second.
Whenever you are doing a JOIN or nested selects, create an INDEX on the field which you are using to crossreference. Even with a few rows, it speeds up the query TREMENDOUSLY. I have 2 tables, one of which had 1000 rows, and the other 3000. A subselect or a JOIN between them took me 58 seconds (and I expect that to increase greatly as more records are added). When I created an index on the field I was using to join them, the query time went down to 0.17 of a second.