Skip to content

Commit 3ea7f0e

Browse files
committed
Fixing incorrect description of PRAGMA optimize.
1 parent 39f586a commit 3ea7f0e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/content/partials/d1/use-pragma-statements.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,10 @@ Refer to the [foreign key documentation](/d1/sql-api/foreign-keys/) to learn mor
414414

415415
### `PRAGMA optimize`
416416

417-
Attempts to [optimize all schemas]() in a database by running various maintenance operations. We recommend running this command after [creating an index](/d1/best-practices/use-indexes/).
417+
Attempts to [optimize all schemas]() in a database by running the `ANALYZE` command. `ANALYZE` updates an internal table which contain statistics about tables and indices. These statistics helps the query planner to execute the input query more efficiently.
418418

419-
Alternatively, to see all optimizations that would have been performed without actually executing them, run `PRAGMA optimize(-1)`.
419+
We recommend running this command after making any changes to the schema (for example, after [creating an index](/d1/best-practices/use-indexes/)).
420420

421-
Refer to [SQLite PRAGMA optimize documentation](https://www.sqlite.org/pragma.html#pragma_optimize) for more information on how the command optimizes a database.
421+
{/* Alternatively, to see all optimizations that would have been performed without actually executing them, run `PRAGMA optimize(-1)`. */}
422+
423+
Refer to [SQLite PRAGMA optimize documentation](https://www.sqlite.org/pragma.html#pragma_optimize) for more information on how `PRAGMA optimize` optimizes a database.

0 commit comments

Comments
 (0)