图片.png
查询语句时间为5秒多
mdol语句
class Hi < ApplicationRecord
establish_connection :qc
self.table_name = 'mz_guahao1'
end
controller 语句
def index
@his = Hi.connection.select_value(sql)
end
sql语句问题,若使用to_char就会导致全表saomia
图片.png
查询语句时间为5秒多
mdol语句
class Hi < ApplicationRecord
establish_connection :qc
self.table_name = 'mz_guahao1'
end
controller 语句
def index
@his = Hi.connection.select_value(sql)
end
sql语句问题,若使用to_char就会导致全表saomia
本文标题:rails 连接已有项目的数据库 查询语句非常慢
本文链接:https://www.haomeiwen.com/subject/ccqtrxtx.html
网友评论