Jump to content

Slow Query Related to Conversions


Recommended Posts

Hi all,

I have the following query appearing very frequently in the slow query log:

# Time: 160819 19:41:51
# Query_time: 0.565665  Lock_time: 0.000026  Rows_sent: 1  Rows_examined: 246907
# Rows_affected: 0
SET timestamp=1471653711;
/*??*/ SELECT ipb_id FROM `convert_link_topics` WHERE foreign_id=56575 AND ( type='topics' OR type='forums_topics' ) AND app=2;

 

I realize that 0.5-0.7 seconds isn't a huge deal, but it is somewhat more important because of the frequency. I'm interested in what this table does for one thing.

Another item is that it appears this query isn't using indexes properly. Notice that it is examining about a quarter million rows when there is a WHERE by id that should (via index) cut it down significantly. However, the index on this column isn't working. The database engine will not select it, and I can only figure it is because this column is a VARCHAR. There only seem to be integers stored here, so I'm not sure why it is that data type. Can anyone help me understand what is going on and maybe suggest a way to improve this?

 

Thanks!

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...