You need to change N to a number - the number of characters that you want to be indexed. Sorry, I don't know how that number should be chosen. I'm not a MySQL expert or anything, I just thought I could help you with the syntax for that command.
Did you read the manual pages that I linked to? It's really just one or a few paragraphs for each of 4 sections that talk about indexes.
BTW, I'm not sure indexing on pagetext will help you at all. It could only have a chance of speeding things up if there was a query being done with a WHERE clause using that column (or maybe an ORDER BY or GROUP or something like that), and there probably isn't. Like I said, I'm not a database expert or anything, but I think blindly creating an index for every column might not be a good idea, since many of them probably won't be used but they all have to be maintained any time the table is changed. What you can do is, if you think a specific page is slow you can use debug mode to display all the queries being done by that page, then see if any are taking an unusually long time, then see if there's something to be done to speed it up.
|