From 6f1f8995bca7c1fda6f523a064e5a3b8d467a340 Mon Sep 17 00:00:00 2001 From: Random Hacker Date: Sat, 28 Aug 2010 17:32:22 +0200 Subject: index on value(sensor_id) --- ebus/model/sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ebus') diff --git a/ebus/model/sql.py b/ebus/model/sql.py index 219cfbc..75ebd0c 100644 --- a/ebus/model/sql.py +++ b/ebus/model/sql.py @@ -27,7 +27,7 @@ class Value(ModelBase): id = Column(Integer, primary_key=True) timestamp = Column(DateTime,index=True) - sensor_id = Column(Integer, ForeignKey("sensor.id")) + sensor_id = Column(Integer,ForeignKey("sensor.id"),index=True) sensor = relationship(Sensor, backref=backref('values', order_by=timestamp)) discriminator = Column('type', String(50)) -- cgit v1.2.1