我有3個表複雜的聯接SQL查詢隨着計時器
日誌
|id| channel_id | date | content_id |
|1 | 3 | <ts> | 1 |
|1 | 3 | <ts> | 2 |
|1 | 4 | <ts> | 4 |
通道
|id| channel_id | limit_repeat_time | limit_timer | limit_count | last_update
|1 | 3 | 60 | 1440 | 50 | <timestamp>
|1 | 4 | 60 | 1440 | 50 | <timestamp>
隊列
|id| channel_id | content_id
|1 | 3 | 1
|1 | 3 | 2
|1 | 4 | 4
我有一個crontab檢查此表和環並導致我的頻道列表我必須更新;
通道有幾個選項 1)limit_repeat time:這意味着這個cron不能更新這個通道小於這個分鐘; exc:如果這個是60,你只能每小時更新一次這個頻道。 2)limit_timer和limit_count這是一個完整的極限計數。喜歡; limit_timer = 1440 limit_count = 50,這是意味着你可以每天補充50含量最高(1440分鐘)
我需要的是 我想找個渠道不更新,並沒有在
insterted更多的則內容我cron設置爲每分鐘,所以我想每分鐘運行一次這個查詢,並且需要更新通道。
在此先感謝!
'content_id'列代表什麼?這是添加到頻道的內容數量? – 2014-11-04 20:01:39