-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 10 4680 6621 30812
C/C++ Header 3 99 286 496
-------------------------------------------------------------------------------
SUM: 13 4779 6907 31308
-------------------------------------------------------------------------------
@comment_cnt = Comment.where(post_id: @category.post_ids)).group(:post_id).count
@comment_last = Comment.where(post_id: @category.post_ids).group(:post_id).having('id = MAX(id)')
tmdb_id = values(tmdb_id),
type = values(type)
+----+------+--------+------+---------------------+
| id | line | status | user | startDate |
+----+------+--------+------+---------------------+
| 1 | TEST | star | NULL | 2015-04-29 12:54:30 |
| 2 | TEST | stop | NULL | 2015-04-29 12:54:59 |
| 3 | FOO | stop | NULL | 2015-04-29 13:07:29 |
| 4 | FOO | star | NULL | 2015-04-29 12:55:21 |
+----+------+--------+------+---------------------+
select id, if(@line=line AND @status!=status,@startDate, NULL) as endDate,
@line:=line as line, @status:=status as status, @startDate:=startDate as startDate
FROM (select id, line,status, startDate from linestatuslog order by line, status, startDate) as c;
+----+---------------------+------+--------+---------------------+
| id | endDate | line | status | startDate |
+----+---------------------+------+--------+---------------------+
| 4 | NULL | FOO | star | 2015-04-29 12:55:21 |
| 3 | 2015-04-29 12:55:21 | FOO | stop | 2015-04-29 13:07:29 |
| 1 | NULL | TEST | star | 2015-04-29 12:54:30 |
| 2 | 2015-04-29 12:54:30 | TEST | stop | 2015-04-29 12:54:59 |
+----+---------------------+------+--------+---------------------+
cat /proc/PROC_ID/limits
redis-benchmark -c 3000 -q -n 10 -t get,set
SET: 322.58 requests per second
GET: 357.14 requests per second
mysql> SELECT AUTO_INCREMENT FROM information_schema.tables where table_schema = DATABASE() and table_name = 'test3';
+----------------+
| AUTO_INCREMENT |
+----------------+
| 16 |
+----------------+
1 row in set (0.00 sec)
mysql> insert ignore into test3(name) VALUES ('xxx'),('aaa'),('fff');
Query OK, 0 rows affected (0.00 sec)
Records: 3 Duplicates: 3 Warnings: 0
mysql> SELECT AUTO_INCREMENT FROM information_schema.tables where table_schema = DATABASE() and table_name = 'test3';
+----------------+
| AUTO_INCREMENT |
+----------------+
| 19 |
+----------------+