<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>luiswood (wood)</title>
    <link>https://ruby-china.org/luiswood</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>一款新的跨平台 Git 客户端 Fork</title>
      <description>&lt;p&gt;试用了一下，挺不错的。官方网址： &lt;a href="https://git-fork.com/" rel="nofollow" target="_blank"&gt;https://git-fork.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2019/c11a2d03-63e2-4685-9648-0754a9e9bcc4.jpg!large" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>luiswood</author>
      <pubDate>Fri, 30 Aug 2019 21:17:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/39003</link>
      <guid>https://ruby-china.org/topics/39003</guid>
    </item>
    <item>
      <title>关于实现一个近期热搜功能</title>
      <description>&lt;h3 id="实现"&gt;实现&lt;/h3&gt;
&lt;p&gt;目前自己用 mysql 实现了一个近期热搜功能，记录关键字、搜索次数、日期三个字段。&lt;/p&gt;

&lt;p&gt;当用户搜索一个关键字时，会使用&lt;code&gt;INSERT INTO DUPLICATE KEY UPDATE&lt;/code&gt;语句对关键字记录创建或更新搜索次数。&lt;/p&gt;

&lt;p&gt;这样我就可以每隔一周，使用 SQL 语句分组累计查询出最近一周 TOP10 的关键字列表，并使用 redis 缓存，过一周后再刷新。&lt;/p&gt;
&lt;h3 id="问题"&gt;问题&lt;/h3&gt;
&lt;p&gt;目前每次刷新缓存时，分组累计查询语句会很慢，每天产生的记录很多，这种查询比较低效。&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;所以想来问一下有没有更高效的实现方式？&lt;/p&gt;

&lt;p&gt;比如用 redis 的 sortset，但使用这个实现的话，取最近一周的日期怎么解决？&lt;/p&gt;</description>
      <author>luiswood</author>
      <pubDate>Tue, 27 Aug 2019 12:53:34 +0800</pubDate>
      <link>https://ruby-china.org/topics/38982</link>
      <guid>https://ruby-china.org/topics/38982</guid>
    </item>
  </channel>
</rss>
