• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
heavy Query

#1
Hi;
How to optimase my query in CodeIgniter;
Query takes a long time;

Demo:
http://www.eduserv.tn/espaces/index.php?...ent/641802

Thks.
Reply

#2
We'd need to see the actual query along with the table schema for everything used in the query. Do you have indexes set on all fields that you are:
1) ordering by
2) joining on
3) selecting on

Proper indexing is how to really optimize the speed. If you only have indexes on your ID's, like autoincrementing fields, that isn't enough when you have a lot of data or complex queries. Without indexes the db engine has to scan every row in the table(s) to find what it's looking for, which can get exponentially complex depending on the joins and whatnot are used.
Reply

#3
Thks y for response;

can see on demo:

http://www.eduserv.tn/espaces/index.php?...ment/64802

Profil: Etablissement
Login : [email protected]
Pass : IrELvcxV

(03-10-2015, 07:14 AM)CroNiX Wrote: We'd need to see the actual query along with the table schema for everything used in the query. Do you have indexes set on all fields that you are:
1) ordering by
2) joining on
3) selecting on

Proper indexing is how to really optimize the speed. If you only have indexes on your ID's, like autoincrementing fields, that isn't enough when you have a lot of data or complex queries. Without indexes the db engine has to scan every row in the table(s) to find what it's looking for, which can get exponentially complex depending on the joins and whatnot are used.
Reply

#4
What he means is post the actual SQL query. A demo doesn't help without knowing how you've written the statement and what schema the tables are using.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.