[wp-hackers] Performance improvement -- '/%postname%/%post_id%/' over '/%postname%/'?

Aahan Krish krish+wphackers at aahan.me
Mon Jan 13 11:25:49 UTC 2014


Thank you, Nikola and Otto. In the end I went with '/%year%/%postname%/'
permalink structure.


On Sat, Jan 11, 2014 at 12:36 PM, Otto <otto at ottodestruct.com> wrote:

> On Sat, Jan 11, 2014 at 1:54 PM, Nikola Nikolov <nikolov.tmw at gmail.com>
> wrote:
> > What could possibly be faster though would be to create a custom post
> type
> > with it's own custom rewrite rules(in the form of
> > "/cpt/%cpt_name%/%post_id%/" - you would get slightly longer permalinks,
> > but it might be worth it. You wouldn't have to pass the post name to the
> > query, but just the ID. It will also require some extra code - to create
> > the proper permalinks when they are requested for a post of that post
> type,
> > to add in the rewrite rules, etc.
>
> The post_name and the ID are both indexed fields in the database. The
> performance difference for querying on one vs. the other is either
> negligible or actually non-existent.
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list