Support » Plugin: Relevanssi - A Better Search » Slow query

  • Hi,
    I’m checking the mysql’s slow queries log and find a few relevanssi queries.

    # Time: 150305 20:09:47
    # Query_time: 2.187755  Lock_time: 0.000091 Rows_sent: 0  Rows_examined: 865046
    SELECT relevanssi.*, relevanssi.title * 5 + relevanssi.content + relevanssi.comment * 0.75 + relevanssi.tag * 0.75 + * 0 + + relevanssi.category * 0.75 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf
    FROM wp_relevanssi AS relevanssi
    WHERE (term LIKE '%locoin' OR term LIKE 'locoin%')   AND ((relevanssi.doc IN (SELECT DISTINCT(posts.ID) FROM wp_posts AS posts WHERE posts.post_type IN ('post', 'page', 'attachment'))) OR (doc = -1))

    Checking it with EXPLAIN, show that is not using an index.
    Screen Grab

    Is there anything it can be done to improve it?

    Thank you

Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari


    Frankly, I’ve got no idea. I don’t understand the inner workings of MySQL; I don’t know what those EXPLAIN results mean.

    There are couple of indices on the table: doc+term+item, term, term_reverse, doc, type+item. If those don’t help, I’m not sure what else will. Any suggestions are welcome, I don’t know anything about MySQL optimization.

Viewing 1 replies (of 1 total)
  • The topic ‘Slow query’ is closed to new replies.