Python 3.x 我怎样才能走得最快?在烧瓶中使用炼金术

Python 3.x 我怎样才能走得最快?在烧瓶中使用炼金术,python-3.x,flask,sqlalchemy,flask-sqlalchemy,Python 3.x,Flask,Sqlalchemy,Flask Sqlalchemy,我有个问题 我曾经使用过python 3.4、sqlalchemy和pymysql 但现在我的烧瓶速度很慢,大概是150秒 我在MySQL 50000row有一个数据库 我怎样才能用最快的烧瓶来炼金术 models.py class User(Base): __tablename__ = 'test' Location = Column('Location',String(20),index=True) Date = Column('Date',String(50), primary_k

我有个问题

我曾经使用过python 3.4、sqlalchemy和pymysql

但现在我的烧瓶速度很慢,大概是150秒

我在MySQL 50000row有一个数据库

我怎样才能用最快的烧瓶来炼金术

models.py

class User(Base):
__tablename__ = 'test'
Location = Column('Location',String(20),index=True)
    Date = Column('Date',String(50), primary_key=True,index=True)
    T1 = Column('T1'Float(precision=5), index=True)
    T2 = Column('T2',Float(precision=5), index=True)
    T3 = Column('T3',Float(precision=5), index=True)
    T4 = Column('T4',Float(precision=5), index=True)
    T5 = Column('T5',Float(precision=5), index=True)

def __init__(self, Location, Date, T1, T2, T3, T4, T5):
   self.Location = Location
   self.Date....
main.py

@app.route('/test/<Location>', methods=['GET'])
def test(Location):
    data = db_session.query(User).filter(Location=Location)
@app.route('/test/',方法=['GET'])
def测试(位置):
data=db\u session.query(用户).filter(位置=位置)

您能帮我吗?

您使用的是什么版本的MySQL?它是如何建立的?它是否在本地计算机上运行?尝试直接在MySQL客户端中运行查询,看看需要多长时间。这应该告诉你是Flask还是MySQL。你使用的是哪个版本的MySQL?它是如何建立的?它是否在本地计算机上运行?尝试直接在MySQL客户端中运行查询,看看需要多长时间。这会告诉你是烧瓶还是MySQL。