Mongodb or Mysql |
Hi
I'm programming website with mysql that you can see here https://worldhotelcodes.com Please search 001h1001 You will see elapse 3 second for search I have 1 million and 200 thousand records in mysql Why it is slow? I was added index on main field Also i dont use like statment for where condition Only use WHERE code = '001h1001' Now i decide use mongodb Is it good solution or i try optimize mysql? Also i have other problem I need make search record on textchange input search that it will be slow if i search record for each character
I searched for '001h1001' many times and it always finished in less than a second. Typically took about 750ms. You have indexed the 'code' field?
I also get it under a second, but I am on 150Mbs cable
I did bring up Chrome Developer Tools and it showed these errors: Code: jquery-3.3.1.min.js:2 jQuery.Deferred exception: Demo is not defined ReferenceError: Demo is not defined What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
@omid_student,
The search performed very quickly for me (under a second). No issues. My question to you is have you done a database analysis to determine if your queries are efficient? If you have the right indexes?
Hi again
Ommm but my net speed is 1mb,search is slow sometimes about 2 second Also i need search realtime records on textchanges input textbox Is it good mysql? Also i use benchmark and i see it elapsed 2 second for search query
If you can run the queries in phpMyAdmin it will tell you how to optimize them.
I would work on optimizing the query first. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
@omid_student,
If you are able to test it with CI profiler turned on ( https://codeigniter.com/user_guide/gener...pplication ) this would be very helpful. It would tell you how fast your queries are and how many are being run on the page. You can then take the actual queries and do database analysis in phpMyAdmin or some other MySQL database tool to determine if your query is efficient.
(09-09-2019, 01:48 PM)InsiteFX Wrote: If you can run the queries in phpMyAdmin it will tell you how to optimize them. I tried it already I think one where have problem (09-09-2019, 05:44 PM)php_rocs Wrote: @omid_student, Yes it is good solution Thanks |
Welcome Guest, Not a member yet? Register Sign In |