Run plan phase in transaction

And active_record transaction driver
Make sure we pass symbol to order_by

Postresql is sensitive about that.