MySQL Forums
Forum List  »  Performance

Re: Sort_merge_passes increasing at 38 per minute...
Posted by: phil yune
Date: December 23, 2011 07:14AM

Variables + Status:
+---------------------------------+------------------------+
| Variable_name                   | Value                  |
+---------------------------------+------------------------+
| innodb_additional_mem_pool_size | 8388608                |
| innodb_autoextend_increment     | 8                      |
| innodb_buffer_pool_awe_mem_mb   | 0                      |
| innodb_buffer_pool_size         | 67108864               |
| innodb_checksums                | ON                     |
| innodb_commit_concurrency       | 0                      |
| innodb_concurrency_tickets      | 500                    |
| innodb_data_file_path           | ibdata1:10M:autoextend |
| innodb_data_home_dir            |                        |
| innodb_adaptive_hash_index      | ON                     |
| innodb_doublewrite              | ON                     |
| innodb_fast_shutdown            | 1                      |
| innodb_file_io_threads          | 4                      |
| innodb_file_per_table           | OFF                    |
| innodb_flush_log_at_trx_commit  | 1                      |
| innodb_flush_method             |                        |
| innodb_force_recovery           | 0                      |
| innodb_lock_wait_timeout        | 50                     |
| innodb_locks_unsafe_for_binlog  | OFF                    |
| innodb_log_arch_dir             |                        |
| innodb_log_archive              | OFF                    |
| innodb_log_buffer_size          | 1048576                |
| innodb_log_file_size            | 5242880                |
| innodb_log_files_in_group       | 2                      |
| innodb_log_group_home_dir       | ./                     |
| innodb_max_dirty_pages_pct      | 90                     |
| innodb_max_purge_lag            | 0                      |
| innodb_mirrored_log_groups      | 1                      |
| innodb_open_files               | 300                    |
| innodb_rollback_on_timeout      | OFF                    |
| innodb_support_xa               | ON                     |
| innodb_sync_spin_loops          | 20                     |
| innodb_table_locks              | ON                     |
| innodb_thread_concurrency       | 8                      |
| innodb_thread_sleep_delay       | 10000                  |
+---------------------------------+------------------------+
35 rows in set (0.00 sec)

+-----------------------------------+--------------+
| Variable_name                     | Value        |
+-----------------------------------+--------------+
| Innodb_buffer_pool_pages_data     | 439          |
| Innodb_buffer_pool_pages_dirty    | 3            |
| Innodb_buffer_pool_pages_flushed  | 6672227      |
| Innodb_buffer_pool_pages_free     | 3649         |
| Innodb_buffer_pool_pages_misc     | 8            |
| Innodb_buffer_pool_pages_total    | 4096         |
| Innodb_buffer_pool_read_ahead_rnd | 1            |
| Innodb_buffer_pool_read_ahead_seq | 0            |
| Innodb_buffer_pool_read_requests  | 327907705850 |
| Innodb_buffer_pool_reads          | 280          |
| Innodb_buffer_pool_wait_free      | 0            |
| Innodb_buffer_pool_write_requests | 33549351     |
| Innodb_data_fsyncs                | 11831129     |
| Innodb_data_pending_fsyncs        | 0            |
| Innodb_data_pending_reads         | 0            |
| Innodb_data_pending_writes        | 0            |
| Innodb_data_read                  | 7606272      |
| Innodb_data_reads                 | 293          |
| Innodb_data_writes                | 16120344     |
| Innodb_data_written               | 224959011840 |
| Innodb_dblwr_pages_written        | 6672227      |
| Innodb_dblwr_writes               | 1802187      |
| Innodb_log_waits                  | 0            |
| Innodb_log_write_requests         | 4187531      |
| Innodb_log_writes                 | 6558680      |
| Innodb_os_log_fsyncs              | 8226456      |
| Innodb_os_log_pending_fsyncs      | 0            |
| Innodb_os_log_pending_writes      | 0            |
| Innodb_os_log_written             | 5469873664   |
| Innodb_page_size                  | 16384        |
| Innodb_pages_created              | 108          |
| Innodb_pages_read                 | 331          |
| Innodb_pages_written              | 6672227      |
| Innodb_row_lock_current_waits     | 0            |
| Innodb_row_lock_time              | 498688       |
| Innodb_row_lock_time_avg          | 645          |
| Innodb_row_lock_time_max          | 14934        |
| Innodb_row_lock_waits             | 773          |
| Innodb_rows_deleted               | 1086         |
| Innodb_rows_inserted              | 2846         |
| Innodb_rows_read                  | 118701433391 |
| Innodb_rows_updated               | 6188298      |
+-----------------------------------+--------------+
42 rows in set (0.00 sec)

Auction Table:

| auctions | CREATE TABLE `auctions` (
  `id` int(11) NOT NULL auto_increment,
  `product_id` int(11) NOT NULL,
  `start_time` datetime NOT NULL,
  `end_time` datetime NOT NULL,
  `max_end` tinyint(1) NOT NULL,
  `max_end_time` datetime NOT NULL,
  `price` decimal(30,2) NOT NULL,
  `autolist` tinyint(1) NOT NULL,
  `featured` tinyint(1) NOT NULL,
  `peak_only` tinyint(1) NOT NULL,
  `nail_bitter` tinyint(1) NOT NULL,
  `be	ginner` tinyint(1) NOT NULL,
  `penny` tinyint(1) NOT NULL,
  `hidden_reserve` decimal(30,2) NOT NULL,
  `bcount` int(11) NOT NULL,
  `random` decimal(30,2) NOT NULL,
  `rev_price` decimal(30,2) NOT NULL,
  `leader_id` int(11) NOT NULL,
  `winner_id` int(11) NOT NULL,
  `status_id` int(11) NOT NULL,
  `active` tinyint(1) NOT NULL,
  `closed` tinyint(1) NOT NULL,
  `bid_debit` int(11) NOT NULL,
  `hits` int(11) NOT NULL,
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  `rup_refunded` datetime default NULL,
  PRIMARY KEY  (`id`),
  KEY `product_id` (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5886 DEFAULT CHARSET=utf8 |

--+------------+-----------------+----------+----------------+----------------------+
| Name     | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time         | Update_time | Check_time | Collation       | Checksum | Create_options | Comment              |
+----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------------+----------+----------------+----------------------+
| auctions | InnoDB |      10 | Compact    | 4152 |            382 |     1589248 |               0 |       114688 |         0 |           5886 | 2010-10-25 01:37:41 | NULL        | NULL       | utf8_general_ci |     NULL |                | InnoDB free: 6144 kB |
+----------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-----------

I'm running SQL 5.0.77.

If we need to eliminate the extra select, this would be the new code:
    UPDATE auctions 
    SET end_time 
        = ADDTIME( CASE WHEN ADDTIME(end_time, var_time_increment) < NOW()
                        THEN NOW()
                        ELSE end_time
                   END
                 , var_time_increment
                 ) 
      , price = price + var_price_increment
      , leader_id = var_leader_id
      , modified = NOW() 
    WHERE id = var_auction_id 
      AND closed = 0;
Should I go ahead and make this change?

Thanks!!

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Sort_merge_passes increasing at 38 per minute...
1111
December 23, 2011 07:14AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.