[sqlalchemy] Re: Selecting distinct entries based on max timestamp

2016-11-21 Thread Jonathan Vanasco
FWIW, I recently had a similar situation and ended using 2 tables -- one as a transaction log and the other with a constantly updated entry. While your approach worked fine, the database performed significantly better with 2 tables because the (vast) majority of queries only needed the most

[sqlalchemy] Re: Selecting distinct entries based on max timestamp

2016-11-21 Thread bkc
Thanks for the book reference Jonathan, it looks very useful! -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a

[sqlalchemy] Re: Selecting distinct entries based on max timestamp

2016-11-21 Thread Paul Giralt
Than you Mike and Jonathan for your replies. I will experiment with this and let you know how it works out. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable

Re: [sqlalchemy] Column value determined as a function return on INSERT

2016-11-21 Thread Alexander O'Donovan-Jones
Simon's answer was almost what I needed, but was missing the details about using context.connection.scalar to run the query. I ended up finding a very similar issue in another thread from a few months ago here: https://groups.google.com/d/msg/sqlalchemy/h71QfUtCCmw/U6ITbv5pFgAJ Thank you both