[wp-trac] [WordPress Trac] #39603: The more posts with similar names you have, the slower you save the next one
WordPress Trac
noreply at wordpress.org
Tue Jan 17 04:04:37 UTC 2017
#39603: The more posts with similar names you have, the slower you save the next
one
-------------------------------------------------+-------------------------
Reporter: bisyarin | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
Component: Posts, Post Types | Review
Severity: normal | Version:
Keywords: has-patch needs-testing needs-unit- | Resolution:
tests | Focuses:
| performance
-------------------------------------------------+-------------------------
Comment (by pento):
Replying to [comment:3 rmccue]:
> Replying to [comment:2 pento]:
> > After that, create another post with slug `bar` - it should be changed
to `bar-3`, but I think [attachment:constant-time-slug-generation.diff]
will return `bar-2`.
>
> This could be fixed with `ORDER BY post_name`, right?
Nope.
{{{
mysql> DROP TABLE IF EXISTS foo;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE TABLE foo (
-> bar VARCHAR(255)
-> );
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO foo(bar) VALUES('baz'),('baz-1'),('baz-2'),('baz-10');
Query OK, 4 rows affected (0.00 sec)
Records: 4 Duplicates: 0 Warnings: 0
mysql> SELECT * FROM foo ORDER BY bar DESC LIMIT 1;
+-------+
| bar |
+-------+
| baz-2 |
+-------+
1 row in set (0.00 sec)
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39603#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list