mysql_slow_queries - exceedingly horrendous output!

Discussion in 'MySQL' started by KenYN, Dec 18, 2008.

  1. #1
    I'm on BlueHost and twice in two nights I've been suspended for slow queries. I'm running WordPress 2.5 with just a few mainstream plugins. Examining the mysql_slow_queries as suggested I see entries like this:

    # Tue Dec 16 19:10:11 2008
    # Query_time: 140  Lock_time: 130  Rows_sent: 1  Rows_examined: 1
    use whatjapa_wrdp1;
    SELECT term_id FROM wp_terms as t WHERE t.slug = 'mortgage'
    Code (markup):
    I'm not sure where mortgage comes from, but am I right in saying that that one SELECT statement is taking over two minutes?

    Another example is:

    # Wed Dec 17 08:10:44 2008
    # Query_time: 59  Lock_time: 0  Rows_sent: 24  Rows_examined: 24
    use whatjapa_wrdp1;
    SELECT *,
      `TABLE_SCHEMA`       AS `Db`,
      `TABLE_NAME`         AS `Name`,
      `ENGINE`             AS `Engine`,
      `ENGINE`             AS `Type`,
      `VERSION`            AS `Version`,
      `ROW_FORMAT`         AS `Row_format`,
      `TABLE_ROWS`         AS `Rows`,
      `AVG_ROW_LENGTH`     AS `Avg_row_length`,
      `DATA_LENGTH`        AS `Data_length`,
      `MAX_DATA_LENGTH`    AS `Max_data_length`,
      `INDEX_LENGTH`       AS `Index_length`,
      `DATA_FREE`          AS `Data_free`,
      `AUTO_INCREMENT`     AS `Auto_increment`,
      `CREATE_TIME`        AS `Create_time`,
      `UPDATE_TIME`        AS `Update_time`,
      `CHECK_TIME`         AS `Check_time`,
      `TABLE_COLLATION`    AS `Collation`,
      `CHECKSUM`           AS `Checksum`,
      `CREATE_OPTIONS`     AS `Create_options`,
      `TABLE_COMMENT`      AS `Comment`
      FROM `information_schema`.`TABLES`
      WHERE BINARY `TABLE_SCHEMA` IN ('whatjapa_wrdp1')
      LIMIT 250 OFFSET 0
    Code (markup):
    I don't think this is my fault - what do you think?
     
    KenYN, Dec 18, 2008 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Did you try using EXPLAIN to know the issue in the queries? How much data do you have in the database?
    Post back the output of the following query

    EXPLAIN SELECT term_id FROM wp_terms as t WHERE t.slug = 'mortgage'
     
    mwasif, Dec 18, 2008 IP
  3. KenYN

    KenYN Peon

    Messages:
    248
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It says:

    id 	select_type 	table 	type 	possible_keys 	key 	key_len 	ref 	rows 	Extra 
    1	SIMPLE		t	const	slug		slug	602		const	1	 
    Code (markup):
    This is a standard WordPress table, and it has 841 records in it.
     
    KenYN, Dec 18, 2008 IP
  4. lomazoma

    lomazoma Active Member

    Messages:
    56
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    93
    #4
    try make repair database from cpanel and optimize it after repair
     
    lomazoma, Dec 22, 2008 IP
  5. azn_romeo_4u

    azn_romeo_4u Peon

    Messages:
    590
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hello, bluehost is the worst host...seriously. I recommend hostgator. Bluehost has like 1000-10000 accounts per server, they are really stingy.
     
    azn_romeo_4u, Dec 28, 2008 IP
  6. KenYN

    KenYN Peon

    Messages:
    248
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    azn, yes, I'm ditching them very soon as my site blew up again today on an even more minimal WordPress install.
     
    KenYN, Dec 29, 2008 IP