V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  MoYi123  ›  全部回复第 22 页 / 共 23 页
回复总数  456
1 ... 14  15  16  17  18  19  20  21  22  23  
2020 年 8 月 25 日
回复了 xmge 创建的主题 程序员 4 千万的数据量, postgre order by 优化。
min_pk,max_pk = select min(primary_key), max(primary_key) from table where a > xx;
select xxxx from tables where min_pk < pk and pk < max_pk and a > xx order by update limit 100;
可以试一试这样有没有用。
参考了这篇博客
https://github.com/digoal/blog/blob/master/202007/20200710_01.md
2020 年 8 月 12 日
回复了 black11black 创建的主题 Python Python 有什么办法异步监控文件修改吗?
同步的库是 select,用 asyncio 应该能改成异步的。
尾递归只是把原先的函数调用栈放到参数里而已,所有的递归在参数中加一个栈都可以改成尾递归。
长度等于逗号数 + 1
2020 年 8 月 3 日
回复了 zzhpeng 创建的主题 MySQL 大佬们求救,慢 SQL 问题
倒数第三句 sql 看起来更加可疑。
图一乐。估计性能还是会有问题。为了方便把后缀单独弄了一列。

create table u_insert
(
id serial primary key,
key text,
value int,
suffix int default 0
);
create unique index on u_insert (key, suffix);

begin;
lock u_insert;
CREATE unlogged TABLE tmp(id serial,key text,value int) on commit drop;
insert into tmp(key, value) values ('a', 1),('a', 2),('b', 1);
insert into u_insert(key, value, suffix)
select key, value, t.suffix + rank() OVER (PARTITION BY key ORDER BY id DESC) as suffix
from tmp,
(select t.key as k, greatest(max(u_insert.suffix), t.suffix) as suffix
from u_insert right join (select unnest(array ['a','b']) as key, 0 as suffix) as t on u_insert.key = t.key group by t.key, t.suffix) as t
where t.k = key;
commit;
2020 年 7 月 26 日
回复了 birdkyle79 创建的主题 程序员 做一道算法题需要花多长时间?
leetcode 的周赛里,我一般前三题 1 题简单,2 题中等用 30 分钟,第四题想一个小时,能不能做出来随缘。
https://github.com/parse-community/parse-server 里面的 dashboard
但是必须建一些它必须的表。
2020 年 7 月 21 日
回复了 GTD 创建的主题 Python Python 如何在包内的某一个模块隐藏某一个函数呢?
inspect 模块可以看的函数的调用栈,如果上一级调用栈不是本模块的函数,就报错。
2020 年 7 月 15 日
回复了 Evilk 创建的主题 PHP 和第三方对接,遇到点问题,求大佬解惑
让他们做个 docker 镜像发过来。
2020 年 7 月 10 日
回复了 cat404 创建的主题 程序员 大佬们来解答一下这个面试题(语言不限)
用栈模拟战斗过程,保存战死士兵的 index,然后输出就行了
2020 年 6 月 12 日
回复了 hejw19970413 创建的主题 LeetCode 我想问一道 LeetCode 变形题:(70)爬楼梯(变形)
三个数字的斐波那契数列
2020 年 6 月 10 日
回复了 Visitor233 创建的主题 程序员 你在程序中用过那些数学公式?
克劳修斯-克拉贝龙公式,化工的老本行了。
1 ... 14  15  16  17  18  19  20  21  22  23  
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   2131 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 32ms · UTC 15:13 · PVG 23:13 · LAX 07:13 · JFK 10:13
♥ Do have faith in what you're doing.