Re: [sqlite] Aggregate and query limit

2007-08-19 Thread John Stanton
The sqlite3_prepare API call compiles the SQL to a target code called VDBE. The VDBE code is executed by the Sqlite VDBE engine. Once compiled the VDBE may e reused. Mina R Waheeb wrote: Hi, Yes, You are right. How SQLite will know the position of the row 990 unless it ordered by indexed

Re: [sqlite] Aggregate and query limit

2007-08-18 Thread Mina R Waheeb
Hi, Yes, You are right. How SQLite will know the position of the row 990 unless it ordered by indexed field. That takes me to another point, How SQLite exactly interpret the query, I read in the documentation "After the parser assembles tokens into complete SQL statements, it calls the code

Re: [sqlite] Aggregate and query limit

2007-08-18 Thread Joe Wilson
--- Mina R Waheeb <[EMAIL PROTECTED]> wrote: > Do you mean the LIMIT in SQLite is not optimized? and the performance > of selecting from table contains 1000 rows match the query condation > equal selecting the same condation with limit 990,10? Pretty much, yes, as it should be. LIMIT is

Re: [sqlite] Aggregate and query limit

2007-08-18 Thread Nuno Lucas
On 8/18/07, Mina R Waheeb <[EMAIL PROTECTED]> wrote: > Hi, > Thanks for reply. I'm still confused about that. I don't know much > about SQLite internals, But what i understanded from your reply that > SQLite fetch any row match the query condation and then apply to it > the GROUP BY then apply

Re: [sqlite] Aggregate and query limit

2007-08-17 Thread Mina R Waheeb
Hi, Thanks for reply. I'm still confused about that. I don't know much about SQLite internals, But what i understanded from your reply that SQLite fetch any row match the query condation and then apply to it the GROUP BY then apply to it the ORDER BY is there is any, And when the LIMIT appears

Re: [sqlite] Aggregate and query limit

2007-08-17 Thread Joe Wilson
--- Mina R Waheeb <[EMAIL PROTECTED]> wrote: > I have some questions about the behavior of aggregate functions and > the result LIMIT. > After register TEST function and executing query (SELECT TEST() FROM > objects group by id LIMIT 30,3) > > I was expect calling back TEST() only 3 times but

Re: [sqlite] Aggregate and query limit

2007-08-17 Thread Mina R Waheeb
om: Mina R Waheeb [mailto:[EMAIL PROTECTED] > Sent: Friday, August 17, 2007 12:12 PM > To: sqlite-users@sqlite.org > Subject: [sqlite] Aggregate and query limit > > Hi, > I have some questions about the behavior of aggregate functions and the > result LIMIT. > After register TES

RE: [sqlite] Aggregate and query limit

2007-08-17 Thread Sreedhar.a
Subject: [sqlite] Aggregate and query limit Hi, I have some questions about the behavior of aggregate functions and the result LIMIT. After register TEST function and executing query (SELECT TEST() FROM objects group by id LIMIT 30,3) I was expect calling back TEST() only 3 times but what happened

[sqlite] Aggregate and query limit

2007-08-17 Thread Mina R Waheeb
Hi, I have some questions about the behavior of aggregate functions and the result LIMIT. After register TEST function and executing query (SELECT TEST() FROM objects group by id LIMIT 30,3) I was expect calling back TEST() only 3 times but what happened is the TEST() is called 33 time, and the