Created
June 27, 2015 18:22
-
-
Save danish-rehman/0872587cb6b58e3205e4 to your computer and use it in GitHub Desktop.
mysql chock problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> desc gif_user; | |
+-------------+--------------+------+-----+-------------------+-----------------------------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+-------------+--------------+------+-----+-------------------+-----------------------------+ | |
| guid | int(11) | NO | PRI | NULL | auto_increment | | |
| user_cookie | varchar(500) | NO | MUL | NULL | | | |
| gif_id | int(11) | NO | | NULL | | | |
| createdon | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | | |
| period | int(11) | YES | | NULL | | | |
mysql> select count(*) from gif_stash; | |
+----------+ | |
| count(*) | | |
+----------+ | |
| 15088 | | |
+----------+ | |
mysql> desc gif_stash; | |
+------------+---------------+------+-----+-------------------+----------------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+------------+---------------+------+-----+-------------------+----------------+ | |
| content_id | int(11) | NO | PRI | NULL | auto_increment | | |
| user_id | int(11) | NO | | NULL | | | |
| url | varchar(766) | YES | | NULL | | | |
| period | int(11) | NO | MUL | NULL | | | |
| title | varchar(766) | YES | UNI | NULL | | | |
| source | varchar(1000) | YES | | NULL | | | |
| createdon | timestamp | NO | MUL | CURRENT_TIMESTAMP | | | |
| gif_size | int(11) | YES | | 0 | | | |
| mp4_size | int(11) | YES | | 0 | | | |
| webm_size | int(11) | YES | | 0 | | | |
| frame_rate | int(11) | YES | | 0 | | | |
| num_frames | int(11) | YES | | 0 | | | |
| label | varchar(200) | YES | | | | | |
| width | int(11) | YES | MUL | 0 | | | |
| height | int(11) | YES | | 0 | | | |
mysql> select count(*) from gif_user; | |
+----------+ | |
| count(*) | | |
+----------+ | |
| 201022 | | |
SELECT url, title, url, content_id, user_id, period as cnt, label, width, height FROM gif_stash | |
WHERE content_id not in (SELECT gif_id FROM gif_user WHERE user_cookie = '80.112.249.196') | |
ORDER BY period DESC LIMIT 550,50 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment