Several days ago, I saw on my post a comment by @arcange, indicating that my query to SteemSQL affected the performance of the server. I contacted @arcange immediately. He kindly explained to me with patience that I should use `CONTAINS()` instead of `LIKE`, and `depth=0` instead of `title = ''` to search efficiently. Now my search is much faster than before. Great thanks to @arcange! You can [vote](https://v2.steemconnect.com/sign/account-witness-vote?witness=arcange&approve=true) @arcange as a witness so as to support his great work! This post tells the details of the story mentioned above. Hopefully it could help other SteemSQL users. 不久前,我的某篇帖子收到来自阿灿哥(arcange)的一条回复: > Hello @dapeng, > > You are issuing query to SteemSQL that negatively impact the infrastructure performances and penalize others users. > > Please contact me on [steem.chat](http://steem.chat/direct/arcange) or on Discord! > 我英语不好,大概感觉是好像我不知怎地把 SteemSQL 服务器给破坏了,好像是捅了大漏子。这个问题不久前 @tvb 跟我讨论过,没想到现在轮到我了,吓得我赶紧去 chat 联系阿灿哥负荆请罪。 原以为会被骂一通,谁料想阿灿哥非常 nice,给我如此这般详细解释了一番。 他说,我在搜索 SteemSQL 数据库的时候,用的两个指令效率太低。一个是 `LIKE`,一个是` title <> ''`。例如,我搜索“华语好声音”活动的帖子时,搜索的条件是以 'cn-voice' 为标签 + 标题不为空: ``` SELECT * FROM Comments WHERE title <> '' AND json_metadata LIKE '%"cn-voice"%' ``` 阿灿哥说,`LIKE`这个操作极度耗费资源。SteemSQL 最近支持对帖子的标题、正文和 json 元数据进行全文检索了,所以应该用 `CONTAINS`来代替 `LIKE`,并且用 `depth = 0` 来选取标题不为空的帖子(> 0的话就是选取评论): ```` SELECT * FROM Comments WHERE depth = 0 AND CONTAINS(json_metadata, "cn-voice") ```` 阿灿哥会说中文,特意告诉我支持中文检索哦,例如: ``` SELECT * FROM Comments WHERE CONTAINS(title, N'月旦评') ``` 用了新方法之后,查询果然快多了,即使数据量大的时候,几秒也能查完,而原先则是需要几十秒甚至几分钟,我还以为是我电脑的问题。 我猜想肯定很多用户都遇到这个问题了,但是我还没看到专门说这个的帖子(如果有,请告诉我),所以就写出来跟大家分享。 感谢阿灿哥!可以通过[投票](https://v2.steemconnect.com/sign/account-witness-vote?witness=arcange&approve=true) @arcange 当见证人来支持他。
post_id | 52,598,756 |
---|---|
author | dapeng |
permlink | improve-the-query-with-contains-and-depth-steemsql |
category | cn |
json_metadata | "{"links": ["https://v2.steemconnect.com/sign/account-witness-vote?witness=arcange&approve=true", "http://steem.chat/direct/arcange"], "format": "markdown", "tags": ["cn", "steem", "steemsql", "cn-programming", "programming"], "app": "steemit/0.1", "users": ["arcange", "dapeng", "tvb"]}" |
created | 2018-06-11 11:50:06 |
last_update | 2018-06-11 12:16:57 |
depth | 0 |
children | 24 |
net_rshares | 2,584,618,182,034 |
last_payout | 2018-06-18 11:50:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 5.667 SBD |
curator_payout_value | 1.125 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 1,869 |
author_reputation | 64,235,894,740,263 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
abit | 0 | 167,526,858,650 | 100% | ||
bue | 0 | 14,100,797,500 | 100% | ||
arcange | 0 | 169,251,028,157 | 25% | ||
deanliu | 0 | 364,081,664,495 | 30% | ||
raphaelle | 0 | 12,942,809,309 | 25% | ||
lemooljiang | 0 | 110,266,032,317 | 21% | ||
rivalhw | 0 | 1,064,461,145,626 | 50% | ||
jianghao | 0 | 231,676,028 | 10% | ||
luneknight | 0 | 221,715,520 | 100% | ||
dapeng | 0 | 199,453,575,476 | 100% | ||
elizacheng | 0 | 4,570,889,494 | 20% | ||
steemitboard | 0 | 339,745,117 | 1% | ||
shenchensucc | 0 | 2,611,910,280 | 50% | ||
sweetieprincess | 0 | 24,652,782,341 | 40% | ||
liangfengyouren | 0 | 1,222,453,119 | 50% | ||
idx | 0 | 10,978,748,413 | 100% | ||
pzhao | 0 | 4,136,248,892 | 100% | ||
jiangchen | 0 | 1,004,852,167 | 10% | ||
tvb | 0 | 35,227,020,115 | 49% | ||
yellowbird | 0 | 22,777,859,954 | 100% | ||
davidke20 | 0 | 1,655,693,688 | 10% | ||
rosatravels | 0 | 20,255,069,282 | 10% | ||
winniex | 0 | 48,079,139,793 | 100% | ||
windowglass | 0 | 40,324,446,808 | 100% | ||
halleyleow | 0 | 1,107,471,133 | 50% | ||
cnbuddy | 0 | 194,479,099,038 | 28.45% | ||
chann | 0 | 4,249,893,266 | 20% | ||
angelina6688 | 0 | 19,132,938,439 | 85% | ||
lebin | 0 | 9,916,380,698 | 8% | ||
coindzs | 0 | 145,332,319 | 100% | ||
superoo7 | 0 | 5,686,110,711 | 30% | ||
wilhb81 | 0 | 1,435,759,242 | 75% | ||
meixia | 0 | 2,578,330,067 | 100% | ||
jerrywjl | 0 | 95,044,128 | 20% | ||
mycat | 0 | 84,905,863 | 12% | ||
historylover | 0 | 415,726,156 | 100% | ||
cn-naughty.boy | 0 | 1,578,851,952 | 7.6% | ||
ethanlee | 0 | 10,897,690,276 | 100% | ||
abss | 0 | 89,989,068 | 11% | ||
ryenneleow | 0 | 717,191,518 | 80% | ||
casperleow | 0 | 809,971,881 | 80% | ||
vinnieleow | 0 | 822,441,794 | 80% | ||
hmayak | 0 | 433,165,320 | 100% | ||
trisolaran | 0 | 9,087,989,080 | 100% | ||
bambugrove | 0 | 149,720,021 | 30% | ||
showshidan | 0 | 110,371,802 | 100% | ||
sunai | 0 | 219,645,721 | 100% | ||
further34 | 0 | 0 | 5% |
arcange会说中文?哇! 他之前也有在我的po文告诉我关于使用CONTAINS来代替LIKE
post_id | 52,599,272 |
---|---|
author | superoo7 |
permlink | re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180611t115448275z |
category | cn |
json_metadata | "{"tags": ["cn"], "app": "steemit/0.1"}" |
created | 2018-06-11 11:54:48 |
last_update | 2018-06-11 11:54:48 |
depth | 1 |
children | 6 |
net_rshares | 0 |
last_payout | 2018-06-18 11:54:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.024 SBD |
curator_payout_value | 0.001 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 48 |
author_reputation | 25,572,770,303,018 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
会一点。可能跟我的德语水平差不多。
post_id | 52,600,875 |
---|---|
author | dapeng |
permlink | re-superoo7-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180611t120848223z |
category | cn |
json_metadata | "{"tags": ["cn"], "app": "steemit/0.1"}" |
created | 2018-06-11 12:08:51 |
last_update | 2018-06-11 12:08:51 |
depth | 2 |
children | 3 |
net_rshares | 0 |
last_payout | 2018-06-18 12:08:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 17 |
author_reputation | 64,235,894,740,263 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
大鹏哥那么谦虚,我有个德国朋友,在那儿几乎都用德语,很难用英文交流.
post_id | 52,601,281 |
---|---|
author | superoo7 |
permlink | re-dapeng-re-superoo7-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180611t121218865z |
category | cn |
json_metadata | "{"tags": ["cn"], "app": "steemit/0.1"}" |
created | 2018-06-11 12:12:18 |
last_update | 2018-06-11 12:12:18 |
depth | 3 |
children | 2 |
net_rshares | 0 |
last_payout | 2018-06-18 12:12:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 34 |
author_reputation | 25,572,770,303,018 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
我学会了几个月的中文说话。不幸的是,我不做法不够。😢
post_id | 52,608,528 |
---|---|
author | arcange |
permlink | re-superoo7-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180611t131531429z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-11 13:15:33 |
last_update | 2018-06-11 13:15:33 |
depth | 2 |
children | 1 |
net_rshares | 0 |
last_payout | 2018-06-18 13:15:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 26 |
author_reputation | 231,443,210,169,699 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
好厉害!!!👏
post_id | 52,611,152 |
---|---|
author | superoo7 |
permlink | re-arcange-re-superoo7-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180611t133848817z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-11 13:38:15 |
last_update | 2018-06-11 13:38:15 |
depth | 3 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-18 13:38:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 7 |
author_reputation | 25,572,770,303,018 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
@dapeng, 代码/编程/IT搞得很溜啊,陶醉本尊了,快扶我一下...
post_id | 52,599,552 |
---|---|
author | cn-naughty.boy |
permlink | 20180611t115706548z-post |
category | cn |
json_metadata | "{"tags": ["cn"]}" |
created | 2018-06-11 11:57:06 |
last_update | 2018-06-11 11:57:06 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-18 11:57:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 37 |
author_reputation | 804,554,661,723 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
upvoted for arcange = 阿灿
post_id | 52,607,071 |
---|---|
author | trisolaran |
permlink | re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180611t130309675z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-11 13:03:09 |
last_update | 2018-06-11 13:03:21 |
depth | 1 |
children | 3 |
net_rshares | 0 |
last_payout | 2018-06-18 13:03:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.164 SBD |
curator_payout_value | 0.014 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 24 |
author_reputation | 1,533,047,303,368 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
哥!
post_id | 52,607,367 |
---|---|
author | dapeng |
permlink | re-trisolaran-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180611t130539586z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-11 13:05:39 |
last_update | 2018-06-11 13:05:39 |
depth | 2 |
children | 1 |
net_rshares | 0 |
last_payout | 2018-06-18 13:05:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 2 |
author_reputation | 64,235,894,740,263 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
没注意,还真自带一个“哥”
post_id | 52,609,399 |
---|---|
author | trisolaran |
permlink | re-dapeng-re-trisolaran-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180611t132335047z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-11 13:23:36 |
last_update | 2018-06-11 13:23:36 |
depth | 3 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-18 13:23:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.044 SBD |
curator_payout_value | 0.014 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 13 |
author_reputation | 1,533,047,303,368 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
非常感谢 🙇
post_id | 52,608,661 |
---|---|
author | arcange |
permlink | re-trisolaran-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180611t131654672z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-11 13:16:54 |
last_update | 2018-06-11 13:16:54 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-18 13:16:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 6 |
author_reputation | 231,443,210,169,699 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
我很高兴能帮助你。
post_id | 52,608,985 |
---|---|
author | arcange |
permlink | re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180611t131945134z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-11 13:19:45 |
last_update | 2018-06-11 13:19:45 |
depth | 1 |
children | 2 |
net_rshares | 0 |
last_payout | 2018-06-18 13:19:45 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.034 SBD |
curator_payout_value | 0.004 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 9 |
author_reputation | 231,443,210,169,699 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
阿灿哥的中文真的不错!
post_id | 52,727,009 |
---|---|
author | dapeng |
permlink | re-arcange-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180612t103217265z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-12 10:32:18 |
last_update | 2018-06-12 10:32:18 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-19 10:32:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 11 |
author_reputation | 64,235,894,740,263 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
早知道那天和你说中文了哈哈哈哈哈
post_id | 52,751,361 |
---|---|
author | tvb |
permlink | re-arcange-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180612t144002015z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-12 14:40:03 |
last_update | 2018-06-12 14:40:03 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-19 14:40:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 16 |
author_reputation | 35,846,309,024,528 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
Congratulations @dapeng! You have completed some achievement on Steemit and have been rewarded with new badge(s) : [![](https://steemitimages.com/70x70/http://steemitboard.com/notifications/postallweek.png)](http://steemitboard.com/@dapeng) You published a post every day of the week <sub>_Click on the badge to view your Board of Honor._</sub> <sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub> To support your work, I also upvoted your post! > Do you like [SteemitBoard's project](https://steemit.com/@steemitboard)? Then **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
post_id | 52,618,484 |
---|---|
author | steemitboard |
permlink | steemitboard-notify-dapeng-20180611t143806000z |
category | cn |
json_metadata | "{"image": ["https://steemitboard.com/img/notify.png"]}" |
created | 2018-06-11 14:38:06 |
last_update | 2018-06-11 14:38:06 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-18 14:38:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 723 |
author_reputation | 38,705,954,145,809 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
续费好了?
post_id | 52,689,190 |
---|---|
author | shine.wong |
permlink | re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180612t025546492z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-12 02:56:09 |
last_update | 2018-06-12 02:56:09 |
depth | 1 |
children | 1 |
net_rshares | 0 |
last_payout | 2018-06-19 02:56:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 5 |
author_reputation | 1,373,339,077,399 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
是的,但是……我想想再说。
post_id | 52,726,890 |
---|---|
author | dapeng |
permlink | re-shinewong-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180612t103059041z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-12 10:31:00 |
last_update | 2018-06-12 10:31:00 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-19 10:31:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 13 |
author_reputation | 64,235,894,740,263 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
LIKE 这个用法应该彻底废弃,低效又低能,再加个通配符*,天下最一烂,没有之一。
post_id | 52,724,004 |
---|---|
author | rivalhw |
permlink | re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180612t100010166z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-12 10:00:06 |
last_update | 2018-06-12 10:00:06 |
depth | 1 |
children | 2 |
net_rshares | 0 |
last_payout | 2018-06-19 10:00:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 1.137 SBD |
curator_payout_value | 0.006 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 41 |
author_reputation | 385,084,072,019,334 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
呜呜呜呜~~~~~
post_id | 52,726,521 |
---|---|
author | dapeng |
permlink | re-rivalhw-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180612t102650312z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-12 10:26:51 |
last_update | 2018-06-12 10:26:51 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-19 10:26:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 9 |
author_reputation | 64,235,894,740,263 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
并不是,contains和like的结果不一样的。 contains是把文本拆成单词再进行对比的。 如果标题是'月旦评|文章标题'时,这样是可以的。 但如果是标日是'月旦评文章标题'里,使用CONTAINS函数时,这个文章就会被漏掉的。
post_id | 52,782,563 |
---|---|
author | tvb |
permlink | re-rivalhw-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180612t195609333z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-12 19:56:09 |
last_update | 2018-06-12 19:56:09 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-19 19:56:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 118 |
author_reputation | 35,846,309,024,528 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
这就是我和 @arange那天研究的内容哈哈。 不过不能这样用的,因为contains这个函数是取单词的,用空格隔开能取到,如果用别的符号应该也能,但如果连在一起比如“月旦评的故事”就搜不到的。
post_id | 52,751,296 |
---|---|
author | tvb |
permlink | re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180612t143926703z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "users": ["arange"], "tags": ["cn"]}" |
created | 2018-06-12 14:39:27 |
last_update | 2018-06-12 14:39:27 |
depth | 1 |
children | 2 |
net_rshares | 0 |
last_payout | 2018-06-19 14:39:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 97 |
author_reputation | 35,846,309,024,528 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
读了十遍,你这条回复我仍然没读懂。
post_id | 52,755,848 |
---|---|
author | dapeng |
permlink | re-tvb-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180612t152215286z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-12 15:22:15 |
last_update | 2018-06-12 15:22:15 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-19 15:22:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 17 |
author_reputation | 64,235,894,740,263 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
微信上和你说
post_id | 52,780,022 |
---|---|
author | tvb |
permlink | re-tvb-re-dapeng-improve-the-query-with-contains-and-depth-steemsql-20180612t192746976z |
category | cn |
json_metadata | "{"app": "steemit/0.1", "tags": ["cn"]}" |
created | 2018-06-12 19:27:48 |
last_update | 2018-06-12 19:27:48 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-06-19 19:27:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 6 |
author_reputation | 35,846,309,024,528 |
root_title | "Improve the query with 'CONTAINS' and 'depth' 用这条指令来大幅度提高 SteemSQL 的查询性能" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |