Skip to content

Commit f27568a

Browse files
committed
Collaboration: Add composite index for awareness room+created_at query
The awareness SELECT filters on WHERE room = %s AND created_at >= %s. The existing UNIQUE KEY room_client covers room but not created_at, requiring a row filter after the index lookup. Adds KEY room_created_at (room, created_at) so both conditions are satisfied directly from the index. The existing KEY created_at is retained for cron cleanup queries that filter on created_at alone. Bumps db_version to 61835.
1 parent 0d77c08 commit f27568a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/wp-admin/includes/schema.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ function wp_get_db_schema( $scope = 'all', $blog_id = null ) {
205205
created_at datetime NOT NULL default '0000-00-00 00:00:00',
206206
PRIMARY KEY (id),
207207
UNIQUE KEY room_client (room,client_id),
208+
KEY room_created_at (room,created_at),
208209
KEY created_at (created_at)
209210
) $charset_collate;\n";
210211

src/wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*
2424
* @global int $wp_db_version
2525
*/
26-
$wp_db_version = 61834;
26+
$wp_db_version = 61835;
2727

2828
/**
2929
* Holds the TinyMCE version.

0 commit comments

Comments
 (0)