aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2018-04-22 20:46:54 -0700
committerAdam Mathes <adam@trenchant.org>2018-04-22 20:46:54 -0700
commitac7010914d71ee590db24a4ad2a1cb16664ba575 (patch)
tree8291c5508f437d366a7a35aae535c2beaae80405
parent75db6ae83df1ef672f63340f05036e1c80f094b7 (diff)
downloadneko-ac7010914d71ee590db24a4ad2a1cb16664ba575.tar.gz
neko-ac7010914d71ee590db24a4ad2a1cb16664ba575.tar.bz2
neko-ac7010914d71ee590db24a4ad2a1cb16664ba575.zip
switch to straight / inner joins for speed, maybe
-rw-r--r--models/item/item.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/models/item/item.go b/models/item/item.go
index 4d3f455..751cb2f 100644
--- a/models/item/item.go
+++ b/models/item/item.go
@@ -117,11 +117,21 @@ func Filter(max_id int64, feed_id int64, category string, unread_only bool, star
var args []interface{}
- query := `SELECT item.id, item.feed_id, item.title, item.url, item.description,
+ // INNER JOIN MACHINE GOOO
+
+ // select STRAIGHT_JOIN item.*, feed.*
+ // FROM item
+ // INNER JOIN feed ON feed.id=item.feed_id
+ // WHERE item.read_state=false and feed.category='news'
+ // ORDER BY item.id desc
+ // LIMIT 15;
+
+ query := `SELECT STRAIGHT_JOIN item.id, item.feed_id, item.title, item.url, item.description,
item.read_state, item.starred, item.publish_date,
item.full_content, item.header_image,
feed.url, feed.title, feed.category
- FROM item,feed
+ FROM item
+ INNER JOIN feed ON feed.id=item.feed_id
WHERE item.feed_id=feed.id `
if max_id != 0 {