postgresql 只改一行就获得100倍性能提升

from https://www.datadoghq.com/blog/100x-faster-postgres-performance-by-changing-1-line/

 

The query optimizer is fooled by the use of ARRAY[...] to list all the primary keys to look up. VALUES (...), (...) lets the optimizer make full use of the primary key index instead. It is literally a one-line change, which makes no semantic difference.

posted @ 2018-06-08 11:10  imklutz  阅读(387)  评论(0编辑  收藏  举报