[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lojban] Re: jboselkei is back



I added some language support to the test jboselkei so that people can select a language when posting and searching. I don't know how to fix the problem of unicode characters being converted into ASCII characters. I also had some other problems with unicode. I had a PHP file that contained literal strings with unicode characters in it and saved it in unicode format, but when I displayed a file that included that file, the PHP code itself was displayed followed by a large amount of Chinese characters. I resaved the file in ANSI format and now names of some other languages appear as question marks on the jboselkei test.

I'm also wondering about the database efficiency of some of the new features I added to jboselkei. I have queries like "SELECT translations.id,translations.entry trentry,translations.postid,posts.entry ptentry,posts.difficulty,translations.date,posts.language FROM translations INNER JOIN posts ON translations.postid=posts.id WHERE (translations.authorid<>1) AND 1 NOT IN (SELECT userid FROM reviews WHERE translations.id=reviews.transid) AND (difficulty BETWEEN 1 AND 5) AND language='en' ORDER BY difficulty DESC LIMIT 0,25;". I don't know much about writing efficient queries. I hope this doesn't just go through the computing resources to retrieve the whole database and then return 25 with the highest difficulty level. Also, I don't believe there is an index on the difficulty field. Should there be? The difficulty field changes a lot so I don't know if it is a good idea to add an index on it.

I was also wondering if I should index the languages field since people will be searching by language. However, that field will have a small number of values that repeat many times. I know that Oracle SQL has a bitwise index which is ideal for this type of data, but I believe that MySQL does not.


--
You received this message because you are subscribed to the Google Groups "lojban" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lojban+unsubscribe@googlegroups.com.
To post to this group, send email to lojban@googlegroups.com.
Visit this group at http://groups.google.com/group/lojban.
For more options, visit https://groups.google.com/groups/opt_out.