Skip to content

Commit

Permalink
Merge pull request #3584 from szarnyasg/nits-20240909g
Browse files Browse the repository at this point in the history
Improve formatting of blog post
  • Loading branch information
szarnyasg authored Sep 9, 2024
2 parents 5627771 + 37155e6 commit addb72d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GIT

GIT
remote: https://github.com/duckdb/rouge.git
revision: 94d6b62ab86a734fca31e4407dfafa013d19c0a1
revision: e09fb64ac1d2b08001c012b96f2e03185f80ca7c
branch: duckdb
specs:
rouge (3.3823.1)
Expand Down
17 changes: 10 additions & 7 deletions _posts/2024-09-09-announcing-duckdb-110.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ SELECT ARRAY(SELECT unnest(range(10))) AS subquery_result;
The `scalar_subquery_error_on_multiple_rows` setting can be set to `false` to revert this behavior.

```sql
SET scalar_subquery_error_on_multiple_rows=false;
SELECT (SELECT unnest(range(10))) as result;
SET scalar_subquery_error_on_multiple_rows = false;
SELECT (SELECT unnest(range(10))) AS result;
```
```text
┌────────┐
Expand Down Expand Up @@ -402,19 +402,22 @@ INSTALL spatial;
LOAD spatial;

-- Create a table with 10_000_000 random points
CREATE TABLE t1 AS SELECT point::GEOMETRY as geom
CREATE TABLE t1 AS SELECT point::GEOMETRY AS geom
FROM st_generatepoints(
{min_x: 0, min_y: 0, max_x: 10_000, max_y: 10_000}::BOX_2D,
10_000_000,
1337
);

-- Create an index on the table.
-- Create an index on the table
CREATE INDEX my_idx ON t1 USING RTREE (geom);

-- Perform a query with a "spatial predicate" on the indexed geometry column
-- Note how the second argument in this case, the ST_MakeEnvelope call is a "constant"
SELECT count(*) FROM t1 WHERE ST_Within(geom, ST_MakeEnvelope(450, 450, 650, 650));
-- Perform a query with a "spatial predicate" on the indexed geometry
-- column. Note how the second argument in this case,
-- the ST_MakeEnvelope call is a "constant"
SELECT count(*)
FROM t1
WHERE ST_Within(geom, ST_MakeEnvelope(450, 450, 650, 650));
```

```text
Expand Down

0 comments on commit addb72d

Please sign in to comment.