Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Keith Medcalf
n sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı > -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] > On Behalf Of Reid Thompson > Sent: Tuesday, 11 April, 2017 07:17 > To: sqlite-users@mailinglists.sqlite.org > Subject: Re: [sqlite] sqlite3_step

Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Richard Hipp
On 4/11/17, Reid Thompson wrote: > > I/and the original implementer, am/were more familiar with PostgreSQL's > MVCC. So I think the issue was the assumption that the query being > stepped through would only ever see the rows as they were at the start > of the query and would walk through them fro

Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Simon Slavin
On 11 Apr 2017, at 2:16pm, Reid Thompson wrote: > I/and the original implementer, am/were more familiar with PostgreSQL's > MVCC. So I think the issue was the assumption that the query being > stepped through would only ever see the rows as they were at the start > of the query and would walk t

Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Reid Thompson
On Tue, 2017-04-11 at 13:17 +0100, Simon Slavin wrote: > On 11 Apr 2017, at 12:33pm, Reid Thompson wrote: >  > > Does 'more complicated' in the below scenario mean that there is > > potential for records to be returned more than once if I use random()? >  > The problem is not to do with random(). 

Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Reid Thompson
>  > Thank you.  I'll make adjustments to my process.  One follow on > question.  This would be a concern regardless of whether random() is > used or not in the ORDER BY clause?  >  > reid sorry - I posted this before receiving/seeing Simon's response. reid ___

Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Reid Thompson
On Tue, 2017-04-11 at 07:39 -0400, Richard Hipp wrote: > On 4/11/17, Reid Thompson wrote: > > On Mon, 2017-04-10 at 21:39 +0100, Simon Slavin wrote: > > > On 10 Apr 2017, at 9:28pm, Reid Thompson wrote: > > >  > > > > my questions are, if I prepare and utilize a statement for a result set > > > >

Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Simon Slavin
On 11 Apr 2017, at 12:33pm, Reid Thompson wrote: > Does 'more complicated' in the below scenario mean that there is > potential for records to be returned more than once if I use random()? The problem is not to do with random(). The problem is to do with modifying a field used in your SELECT

Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Richard Hipp
On 4/11/17, Reid Thompson wrote: > On Mon, 2017-04-10 at 21:39 +0100, Simon Slavin wrote: >> On 10 Apr 2017, at 9:28pm, Reid Thompson wrote: >> >> > my questions are, if I prepare and utilize a statement for a result set >> > in the tens of thousands (or more) using a where clause along the lines

Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-11 Thread Reid Thompson
On Mon, 2017-04-10 at 21:39 +0100, Simon Slavin wrote: > On 10 Apr 2017, at 9:28pm, Reid Thompson wrote: >  > > my questions are, if I prepare and utilize a statement for a result set > > in the tens of thousands (or more) using a where clause along the lines > > of > >    "ORDER BY batch_id, due_

Re: [sqlite] sqlite3_step and ORDER BY random() question.

2017-04-10 Thread Simon Slavin
On 10 Apr 2017, at 9:28pm, Reid Thompson wrote: > my questions are, if I prepare and utilize a statement for a result set > in the tens of thousands (or more) using a where clause along the lines > of >"ORDER BY batch_id, due_datetime, random()" > > 1) As I sqlite3_step through the result s

[sqlite] sqlite3_step and ORDER BY random() question.

2017-04-10 Thread Reid Thompson
hi, and thanks. my questions are, if I prepare and utilize a statement for a result set in the tens of thousands (or more) using a where clause along the lines of    "ORDER BY batch_id, due_datetime, random()" 1) As I sqlite3_step through the result set, am I guaranteed to get each row only once?