MySQL Forums
Forum List  »  Newbie

Re: optimising a create table as select
Posted by: Peter Brawley
Date: April 29, 2014 01:34PM

I would first optimise the select without the Create section ...

- change the date_sub(sysdate...) call to a literal value
- index t1 on (id,created_at), t2 on trip_id

Consider doing this test with a subset copied to another table, to see how optimising changes performance. Remember to turn caching off ...

SET LOCAL query_cache_type = 0;
SET GLOBAL query_cache_size = 0;
RESET QUERY CACHE;

... before any of this, otherwise your results will be meaningless.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.