djp1988 Posted July 1, 2009 Share Posted July 1, 2009 I have a slow ajax, it is performing a simple select with a LIKE statement, but it is taking up to 9 seconds to finish, which is quite slow, my table has over 16000 rows is this the problem and if so what should I do to get around the problem?The actual table is 1.5Mb in size and has 8 fields, int(10),smallint(2), and 6 varchar(50) Link to comment Share on other sites More sharing options...
justsomeguy Posted July 1, 2009 Share Posted July 1, 2009 Look into adding fulltext indexes on any fields that you are using LIKE with, and for other fields that you are using in the WHERE clause create regular indexes. Indexes speed up searching but slightly slow down inserting, updating, and deleting. Link to comment Share on other sites More sharing options...
djp1988 Posted July 4, 2009 Author Share Posted July 4, 2009 Thanks, really did speed it up, my table was an Innodb but i sacraficed that... speed was more important Link to comment Share on other sites More sharing options...
justsomeguy Posted July 5, 2009 Share Posted July 5, 2009 More important than what? I use InnoDB for most things because of concurrency and table-locking issues with MyISAM. Link to comment Share on other sites More sharing options...
es131245 Posted July 9, 2009 Share Posted July 9, 2009 How to know speed of the functions codes and scripts??? How to compare them by speed??? Link to comment Share on other sites More sharing options...
justsomeguy Posted July 9, 2009 Share Posted July 9, 2009 Put them in a loop and time it. Have a loop that runs a certain piece of code several hundred thousand times, and time how long it takes the loop to finish, then divide by the number of times the loop ran to get the average time for each iteration. Most languages have various ways to keep track of time. Link to comment Share on other sites More sharing options...
djp1988 Posted July 9, 2009 Author Share Posted July 9, 2009 I was using Inodb to keep everything tied together, and i didn't need to time the query, it literally took up to 10 seconds to produce a result and now it does it in less the half a second Link to comment Share on other sites More sharing options...
justsomeguy Posted July 9, 2009 Share Posted July 9, 2009 Indexes have a lot more to do with that than the storage engine. Link to comment Share on other sites More sharing options...
djp1988 Posted July 16, 2009 Author Share Posted July 16, 2009 Oh well in Innodb I couldn't add a fullindex to any fields, the only reason the mysql gave me was it can't add fulltexxt index to inodb, so i switched back to MyISAM Link to comment Share on other sites More sharing options...
justsomeguy Posted July 16, 2009 Share Posted July 16, 2009 That's correct, InnoDB doesn't support fulltext indexes. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.