瀏覽代碼

Merge pull request #3 from database-pizza/docs/limits-and-aggregates

docs: 64-connection default and GROUP_CONCAT/TOTAL support
Danilo Fragoso 16 小時之前
父節點
當前提交
7a5e36be96

+ 4 - 2
src/content/docs/guides/limits.md

@@ -16,9 +16,11 @@ Quotas apply per organization and cover four dimensions:
 | Databases | 3 | Active databases in the organization |
 | Storage | 100 MB | Allocated on-disk space for the organization |
 | Queries | 500,000 / week | Queries across all surfaces |
-| Connections | 8 concurrent (compiled fallback) | Open PostgreSQL connections |
+| Connections | 64 concurrent | Open PostgreSQL connections |
 
-Queries and bytes-read are counted per organization per week; concurrent connections are measured at any instant. Usage is visible in the dashboard's **Quota** view and through `GET /api/v1/orgs/{id}/quota`, which returns `usage.active_connections` alongside `quota.max_concurrent_connections`. The dashboard value is authoritative: organizations normally have an explicit quota row, so the compiled fallback of 8 only applies when no override exists.
+Queries and bytes-read are counted per organization per week; concurrent connections are measured at any instant. Usage is visible in the dashboard's **Quota** view and through `GET /api/v1/orgs/{id}/quota`, which returns `usage.active_connections` alongside `quota.max_concurrent_connections`.
+
+The default is 64 concurrent connections for new organizations. Migration `020` raises every existing organization from the earlier temporary cap of 8 to 64; organizations with a larger pooled workload can have an explicit override. The value shown in the dashboard is authoritative.
 
 ### Connections and idle disconnects
 

+ 2 - 3
src/content/docs/sql-reference/compatibility.md

@@ -57,7 +57,6 @@ Do not rely on the following behavior yet:
 - `SELECT ... FOR UPDATE` and `NOWAIT`/`SKIP LOCKED` are rejected with `0A000`; transactions are optimistic and have no row locks.
 - `RIGHT JOIN`, `FULL JOIN`, `JOIN ... USING`, and `NATURAL JOIN` may parse but do not execute correctly.
 - DDL changes such as `CREATE TABLE` are not rolled back by `ROLLBACK`.
-- `GROUP_CONCAT` and `TOTAL` are not safe to execute.
 - Result column type metadata is only reported for single-table direct column projections; expressions, joins, and unknown columns are still reported as `TEXT`.
 
 Unsupported syntax normally returns an error. The items above are called out separately because accepting syntax without enforcing its semantics can cause incorrect application behavior.
@@ -161,8 +160,8 @@ PizzaSQL accepts many familiar type names but does not implement PostgreSQL's st
 | --- | --- | --- | --- |
 | `COUNT`, `SUM`, `AVG`, `MIN`, and `MAX` | Supported | Supported | Supported |
 | `COUNT(DISTINCT ...)` | Supported | Supported | Supported |
-| `GROUP_CONCAT` | Unsafe; currently has a recursion failure | Supported | Use `STRING_AGG` |
-| `TOTAL` | Unsafe; currently has a recursion failure | Supported | Unsupported |
+| `GROUP_CONCAT` | Supported, including `DISTINCT` and a custom separator | Supported | Use `STRING_AGG` |
+| `TOTAL` | Supported; returns `0` on an empty set | Supported | Unsupported |
 | Common string functions | Partial | Supported | Supported |
 | Common math functions | Partial | Supported | Supported |
 | `CEIL`, `FLOOR`, and `MOD` | Unsafe; declared but currently return `NULL` | Supported | Supported |

+ 4 - 2
src/content/docs/sql-reference/functions.md

@@ -21,11 +21,13 @@ Used in `SELECT` with or without `GROUP BY`, and in `HAVING`.
 | `AVG(expr)` | average (real); `NULL` when no values |
 | `MIN(expr)` | minimum, ignoring `NULL`s |
 | `MAX(expr)` | maximum, ignoring `NULL`s |
+| `GROUP_CONCAT(expr [, separator])` | concatenates non-`NULL` values with `,` by default; `DISTINCT` de-duplicates; returns `NULL` when there are no values |
+| `TOTAL(expr)` | sum as a real; returns `0` (not `NULL`) when there are no values |
 
 - Aggregates may be nested inside expressions: `SELECT sum(x) / count(x) FROM t`.
-- On an empty input set, `COUNT` returns `0`; `SUM`, `AVG`, `MIN`, `MAX` return `NULL`.
+- On an empty input set, `COUNT` and `TOTAL` return `0`; `SUM`, `AVG`, `MIN`, `MAX`, and `GROUP_CONCAT` return `NULL`.
 - `MIN`/`MAX` also work as *scalar* functions over multiple arguments: `MIN(a, b, c)`.
-- `TOTAL` and `GROUP_CONCAT` are declared in the catalog but **not implemented** — do not rely on them.
+- `GROUP_CONCAT(DISTINCT expr)` de-duplicates after `NULL` values are skipped. The optional separator is evaluated per row (use a literal).
 
 ## Scalar functions