Re: psycopg2 faster way to retrieve last x records

2006-11-08 Thread Luis P. Mendes
Em Tue, 07 Nov 2006 17:03:17 -0800, Stuart Bishop escreveu: > > The following SQL statement will return the last 200 rows in reverse order: > > SELECT * FROM seconds ORDER BY tempounix DESC LIMIT 200 > > This will only send 200 rows from the server to the client (your existing > approach will s

Re: psycopg2 faster way to retrieve last x records

2006-11-07 Thread Stuart Bishop
Luis P. Mendes wrote: > Hi, > > I would like to know if there is a better way to do what I'm already doing > as stated in the following example, when using psycopg2 with PostgresQL. > ... > nr_bars_before = 200 > tabela = 'seconds' > sqlString = "SELECT * FROM " + tabela + " OR

psycopg2 faster way to retrieve last x records

2006-11-07 Thread Luis P. Mendes
Hi, I would like to know if there is a better way to do what I'm already doing as stated in the following example, when using psycopg2 with PostgresQL. ... nr_bars_before = 200 tabela = 'seconds' sqlString = "SELECT * FROM " + tabela + " ORDER BY tempounix;" curs = self.conn.cu