知玄|盈尺 surinch (@fastgridtrader) profile picture

上海盈尺网络科技 https://nitter.gq/t.co/T0Kj0AuqR7|数据技术产品和服务· 亚马逊卖家Agent|量化交易爱好者

Joined May 2022
PostgreSQL 14 hits EOL on Nov 12. We tested 14→17: pg_upgrade took ~2s, but pg_stats was empty afterwards and one JOIN went 184ms → 994ms. Run vacuumdb --analyze-in-stages BEFORE sending traffic. Upgrading to 18? Re-create extended stats. PG14 将于 11-12 停更。实测 14→17:pg_upgrade 只用 2 秒,但升完统计信息为空,同一条 JOIN 从 184ms 变成 994ms。放流量前先跑 vacuumdb --analyze-in-stages;升 18 记得补扩展统计。 PG14 升级体检 11-11 上线,前 50 位预约送迁移风险评估: surinch.com/tools/db-migrati… #PostgreSQL
117
我们怎么用 DS Bot 做数据治理与数仓交付:1 个工程师 2 天产出客户可复算的诊断报告 最后核对 2026-11-18:传统数据治理与数仓咨询常卡在“制度 PPT 落不了地”或“不敢开放生产库超管权限”。盈尺通过 DS Bot 数据治理交付台(本地只读插件,数据不出客户环境),让 1 名交付工程师在 2 天内基于 DDL 或字段清单 CSV 跑通四包流水线与独立复算,交付客户自己能用 shasum 与 SQL 复核的诊断报告,再按主题推进数仓建设与团队赋能。 surinch.com/resources/dsbot-…
53
PostgreSQL: FATAL: role "app" does not exist The login role in your connection string doesn't exist on the cluster you actually reached. First confirm host, port and instance. Roles are cluster-wide, not per database, and a single-database pg_dump doesn't include them (pg_dumpall --globals-only does), so a new instance restored from a db dump can lack them. Check who exists: SELECT rolname FROM pg_roles ORDER BY 1; A missing database is a different error: FATAL: database "x" does not exist. #PostgreSQL
34
PostgreSQL: ERROR: canceling statement due to statement timeout The timer fired. That is not the same as "the query is slow on its own": time spent waiting for a lock counts too. Check both: SHOW statement_timeout; SELECT pid, wait_event_type, wait_event, state, query FROM pg_stat_activity WHERE wait_event_type = 'Lock'; The value can come from the role, the database, the connection string or the ORM, not only postgresql.conf. List the per-role and per-database settings: SELECT * FROM pg_db_role_setting; Walkthrough: surinch.com/tools/postgresql… #PostgreSQL
1
48
Small correction on the mechanism: the cost there is time, not a table-level exclusive lock. For each row deleted from A, the FK trigger looks up matching rows in B, and without an index that's a sequential scan of B. Locks on B stay row-level. Easy to confirm: EXPLAIN ANALYZE the DELETE and read the "Trigger for constraint" line.
21
PostgreSQL: ERROR: deadlock detected (SQLSTATE 40P01) Postgres doesn't check for deadlocks right away. It waits deadlock_timeout (default 1s), finds the cycle, and rolls back one whole transaction, not just the statement. In our test (two sessions updating two rows in opposite order) the error came at about 1.51s with the default and 0.71s with 200ms. Lowering it shortens the wait; it fixes nothing, and the docs treat 1s as about the practical minimum. Fix: lock rows in the same order everywhere (e.g. ORDER BY id FOR UPDATE) and retry the whole transaction on 40P01. The full SQL is in the server log, not the client error. #PostgreSQL
42
PostgreSQL: FATAL: sorry, too many clients already (SQLSTATE 53300) Every slot in max_connections is taken, including the superuser reserve. Existing sessions keep working; only new connections are refused. Before raising max_connections (needs a restart, and only delays the next one), see who holds the slots: SELECT usename, application_name, state, count(*) FROM pg_stat_activity GROUP BY 1, 2, 3 ORDER BY 4 DESC; Many idle or idle in transaction sessions usually means you need a pooler or timeouts, not more connections. On 16+ the "remaining connection slots are reserved" wording changed, so log alerts keyed on the PG14 text can miss it. surinch.com/tools/postgresql… #PostgreSQL
22
An AI agent writes CREATE INDEX for a table with a billion rows the same way it does for one with ten. Before letting one write Postgres migrations, we'd hold it to three rules: 1. CREATE INDEX CONCURRENTLY, and never inside BEGIN/COMMIT 2. SET lock_timeout = '3s' before any ALTER TABLE, so a blocked change fails fast instead of queueing every query behind it 3. List the row count of every table it touches It drafts. A person who knows the table sizes runs it. 让 AI 写迁移前先定三条:建索引用 CONCURRENTLY(不放事务里)、ALTER 前设 lock_timeout、列出涉及表的行数。它起草,懂数据量的人执行。 #PostgreSQL #AI
1
52
MySQL ERROR 1062: Duplicate entry 'x' for key 'y' A unique index (or the primary key) already holds that value. Read the key name in the message before guessing which column collided. Read-only checks: SHOW INDEX FROM your_table WHERE Non_unique = 0; SELECT * FROM your_table WHERE conflict_col = 'x'; ON DUPLICATE KEY UPDATE triggers on a duplicate in ANY unique index, not only the one you had in mind, which is painful on tables with several unique keys. REPLACE INTO deletes the old row and inserts a new one, which is rarely what you want in an app path. #MySQL
28
Before you let an AI agent touch a live Amazon listing, make it show a diff. Old vs new, bullet by bullet, field by field. A human says yes per change, and every new claim must point back to a source: a review, a spec sheet, a backend field. If it can't point back, the sentence goes. Slower than "just apply it". Also how you avoid shipping a claim nobody can verify. 让 AI 改 Listing 前,先让它出改动对照:逐字段比,人逐条批,新卖点要能指回来源,指不回就删。 #AmazonSeller #AI
1
38
FBA sellers: removal or disposal orders submitted by Nov 14, 11:59 PM PT aren't charged this month's aged inventory surcharge, even if the units haven't left the warehouse yet. The surcharge is assessed on the 15th. Removal fees still apply. Check units about to cross 270 days first: at 271 days the surcharge jumps from $1.50 to $5.45 per cubic foot. FBA:11-14 23:59 PT(北京时间 11-15 15:59)前提交移除或弃置,这些件不计本月超龄附加费;先看快跨 270 天的,271 天起从 $1.50 跳到 $5.45/立方英尺。 #AmazonFBA
1
1
1
33
Amazon sellers: would you let AI write your plan of action? Our line: AI can organize the defect order report, check each section against the violation, ASINs and orders in the notice, and flag words nobody can verify ("always", "immediately"). The root cause we write ourselves. Only we know which step, person or supplier failed, and Amazon's guidance says not to copy other plans. Where do you draw the line? POA 能不能让 AI 写?我们只让它整理报表和核对,根本原因自己写。你的底线在哪? #AmazonSeller #AI
2
1
51
Amazon US sellers: the deadline to submit Black Friday / Cyber Monday deals is Nov 13. Amazon hasn't published the hour, so treat it as early on the 13th, not late. Before paying for a deal, run the fee math once: - Lightning Deal, Best Deal, Prime Exclusive Discount: $100 each + 1.5% of promo sales - Coupon: $5 + 2.5% They break even at $9,500 of promo sales. Below that, a coupon costs less in fees, though it gets less visibility. 黑五网一 Deal 提报 11-13 截止,几点官方没写,别卡最后。Deal 类 $100+1.5%,券 $5+2.5%,促销销售额 $9,500 以下券的费用更低: surinch.com/resources/amazon… #AmazonSeller
1
1
56
不懂作图分析,但这个图看着莫名有一种美感,跟着直觉走
$ZEC Price Prediction for Next 3 Months Entered the accumulation phase. You have time until the end of the year.
1
27
Postgres: a query is slow only sometimes, and by the time you run EXPLAIN it's fast. Capture the plan while it happens with auto_explain. LOAD 'auto_explain'; -- superuser SET auto_explain.log_min_duration = '500ms'; Plans of statements that ran ≥500ms go to the server log. auto_explain.log_analyze = on adds per-node timing to every statement executed, not only the logged ones, and the docs warn this can hurt performance badly. log_timing = off cuts that cost but keeps only row counts; sample_rate explains just a fraction of statements. For all sessions, use session_preload_libraries instead of LOAD. #PostgreSQL
34
MySQL ERROR 1406: Data too long for column 'title' at row 1 Two units to keep straight: - VARCHAR(N) / CHAR(N): N is characters. VARCHAR(10) held 10 Chinese characters (30 bytes) in our 8.4.7 test - TEXT: 65,535 bytes. In utf8mb4 that was 21,845 Chinese characters; 21,846 failed "at row N" is the Nth row of that statement. The quieter danger is no error at all: with sql_mode='' or INSERT IGNORE, MySQL truncates and only raises Warning 1265. Run SHOW WARNINGS after bulk loads. #MySQL
1
66
PostgreSQL: ERROR: permission denied for table orders (SQLSTATE 42501) Three usual causes: 1. Never granted 2. GRANT ... ON ALL TABLES IN SCHEMA only covers tables that existed when you ran it. Tables created later need ALTER DEFAULT PRIVILEGES, which only applies to objects later created by the role it names (default: the role running it) 3. A column-level grant, then SELECT * Table grant fixed and INSERT still fails? A serial column also needs: GRANT USAGE ON SEQUENCE orders_id_seq TO app; And on PG15+, new databases no longer give PUBLIC CREATE on the public schema. #PostgreSQL
12
MySQL 8.4: debugging ERROR 1215 "Cannot add foreign key constraint" with the classic checklist (types, charset, index)? You may be chasing an error you won't see. In our test on 8.4.7 (20 ways to break a foreign key, synthetic tables), only 3 still returned 1215. Type or charset mismatch gave 3780, a parent column without a unique key 6125, a missing parent table 1824, a missing index 1822. The 3 that still say 1215: a temporary table, ON UPDATE CASCADE on a stored generated column's base column, and a type mismatch after FOREIGN_KEY_CHECKS=0. Worse are 2 that say nothing: a MyISAM child silently drops the FK, and with checks=0 the FK is added over orphan rows. 8.4 上 20 种外键失败只有 3 种还报 1215,另有 2 种根本不报错。码对照和只读巡检 SQL: surinch.com/resources/mysql-… #MySQL
1
1
16
Things we don't let an AI agent do on our Amazon account, even when it technically could: 1. Submit an appeal or plan of action 2. Delete a listing (some can't be brought back) 3. Change a price outside the min/max we set 4. Add a product claim with no source behind it It drafts, checks and flags. A person clicks submit. 我们不让 AI agent 在亚马逊后台做的 4 件事:提交申诉/POA、删 Listing、超出上下限改价、加没有来源的卖点。它起草、核对、标红,提交由人点。 #AmazonSeller #AI
2
1
68
If software changes your Amazon bids, every change needs a receipt: time, campaign, old bid, new bid, and which rule fired. Without that log, a bad day turns into guessing whether it was the market, the listing or the rule. With it, you can replay the day and switch off one rule instead of all of them. Rules you wrote, limits you set, a dry run first, then the log. That is our minimum before anything touches live campaigns. 让软件改亚马逊出价,每次改动都要留回执:时间、活动、旧价、新价、触发的哪条规则。出了坏日子才能回放,只关一条规则。 #AmazonPPC #AI
1
1
27
Amazon sellers: on a brand-new listing, how many clicks do you give a keyword before you pause it? We use about 22 at an expected 10% conversion rate, and we don't change bids, listing and targeting in the same week. Changing everything at once is how you end up not knowing what worked. What's your number? 新品一个词你给多少次点击再停?我们按 10% 转化给约 22 次,而且同一周不同时改出价、Listing 和定向。你的数字是多少? #AmazonPPC
7