Re: [sqlite] Row count of a partial index ?

2018-05-05 Thread Richard Hipp
On 5/5/18, Deon Brewis wrote: > Is there a direct way to query how many rows are in a partial index? > > I know I can repeat the WHERE clause expression in the query, but this is > for a dynamically constructed index and knowing what the current "where" > clause is on the index

Re: [sqlite] row count after a select

2008-11-05 Thread Igor Tandetnik
Ken <[EMAIL PROTECTED]> wrote: > Igor I disagree, but please feel free to correct me if I'm wrong. > Consider the following sql statement: > > select * from table1 order by last_name; > > Sqlite must first order the data since an order by clause is > specified. (assuming there is no index to

Re: [sqlite] row count after a select

2008-11-05 Thread Ken
k <[EMAIL PROTECTED]> > Subject: Re: [sqlite] row count after a select > To: sqlite-users@sqlite.org > Date: Wednesday, November 5, 2008, 7:38 AM > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Do you know a way to count the number of rows > ide

Re: [sqlite] row count after a select

2008-11-05 Thread Igor Tandetnik
"LEMAIRE, Vincent (AUSY FRANCE)" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I just imagined that when the engine calculates a 'count(*)' it > doesn't loop on each result row "just" for counting It does, in fact. Igor Tandetnik

Re: [sqlite] row count after a select

2008-11-05 Thread LEMAIRE, Vincent (AUSY FRANCE)
lto:[EMAIL PROTECTED] la part de Igor Tandetnik Envoyé : mercredi 5 novembre 2008 14:38 À : sqlite-users@sqlite.org Objet : Re: [sqlite] row count after a select <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Do you know a way to count the number of rows identified by a selec

Re: [sqlite] row count after a select

2008-11-05 Thread Igor Tandetnik
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Do you know a way to count the number of rows identified by a select > statement, just after the first call to sqlite3_step ? Of course > without fetching the entire result set, nor having to systematically > add count(*) You seem to

Re: [sqlite] Row count after prepare

2005-03-16 Thread Marcelo Zamateo
Leif: There may be better solutions, but you don't need to scan the SQL, just put it as subquery: sqlite3_printf "Select Count(*) from (%s)", pSQL will do the work for you. Remember what i said about Group by clauses. Anyway i think a function like sqlite3_row_count(hStmt) would be fantastic.

Re: [sqlite] Row count after prepare

2005-03-15 Thread Leif Jensen
Hi Marcelo, It would, but I don't know the contents of the SQL at the point where I need get the row count, so I would have to scan the statement. Putting in the extra 'count(*)' all over is not really possible. Does anyone know the timing of a sqlite3_step() compared to sqlite3_step()

Re: [sqlite] Row count after prepare

2005-03-15 Thread Marcelo Zamateo
Hi Leif: Will "Select Count(*) from (Your_SQL)" give you what you want? Be careful if Your_SQL includes Group By clause, don't know if work as expected. Marcelo

Re: [sqlite] Row count after prepare

2005-03-15 Thread Kurt Welgehausen
> ... guess I will have to use sqlite3_get_table in this case Be aware that sqlite3_get_table is no longer a recommended API and may not do everything you want. See Regards

Re: [sqlite] Row count after prepare

2005-03-15 Thread Leif Jensen
Hi Dan, Ah yes, of course (I knew this was a newbie question ;-) ). So I guess I will have to use sqlite3_get_table in this case. Thank you for the enlightment, Leif Dan Kennedy wrote: --- Leif Jensen <[EMAIL PROTECTED]> wrote: Hi All, I'm quite new to SQLite, but like it very

Re: [sqlite] Row count after prepare

2005-03-15 Thread Dan Kennedy
--- Leif Jensen <[EMAIL PROTECTED]> wrote: > Hi All, > > I'm quite new to SQLite, but like it very much. > >I am trying it out for an existing applicationm which seems good, but > I have one problem: > >How do I get the number of rows in the result set after having called >

Re: [sqlite] Row count in database

2004-12-21 Thread Christopher Petrilli
Oy! After doing some research and actually changing machines, I isolated the problem. Linux. well, no, not really, but the drivers for the SATA controller I have are so horrendously bad that they crap out under load. How they ever got considered "releasable" is another question entirely. Once

Re: [sqlite] Row count in database

2004-12-17 Thread Jakub Adamek
Richard, and how about doing both? Using BEGIN ... COMMIT and at the same time turning off syncing? Jakub D. Richard Hipp wrote: Christopher Petrilli wrote: Has anyone had any experience in storing a million or more rows in a SQLite3 database? I've got a database that I've been building, which

Re: [sqlite] Row count in database

2004-12-15 Thread Ara.T.Howard
On Wed, 15 Dec 2004, Christopher Petrilli wrote: One thing I've noticed is that if I turn of synchronous, the filesystem slowly slows down, which is fun, but it doesn't do so enough that it's a major issue. I'm using the APSW wrapper for Python, which is basically a very thin wrapper over the

Re: [sqlite] Row count in database

2004-12-15 Thread Christopher Petrilli
On Wed, 15 Dec 2004 08:47:34 -0500, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > Christopher Petrilli wrote: > > Has anyone had any experience in storing a million or more rows in a > > SQLite3 database? I've got a database that I've been building, which > > gets 250 inserts/second, roughly, and

Re: [sqlite] Row count in database

2004-12-15 Thread D. Richard Hipp
Christopher Petrilli wrote: Has anyone had any experience in storing a million or more rows in a SQLite3 database? I've got a database that I've been building, which gets 250 inserts/second, roughly, and which has about 3M rows in it. At that point, the CPU load is huge. The other thing to

Re: [sqlite] Row count in database

2004-12-15 Thread D. Richard Hipp
Christopher Petrilli wrote: Has anyone had any experience in storing a million or more rows in a SQLite3 database? I've got a database that I've been building, which gets 250 inserts/second, roughly, and which has about 3M rows in it. At that point, the CPU load is huge. Note that I've got

Re: [sqlite] Row count in database

2004-12-14 Thread Ara.T.Howard
On Tue, 14 Dec 2004, Christopher Petrilli wrote: On Tue, 14 Dec 2004 12:03:01 -0700 (MST), Ara.T.Howard <[EMAIL PROTECTED]> wrote: On Tue, 14 Dec 2004, Christopher Petrilli wrote: Has anyone had any experience in storing a million or more rows in a SQLite3 database? I've got a database that I've

Re: [sqlite] Row count in database

2004-12-14 Thread Christopher Petrilli
On Tue, 14 Dec 2004 13:54:35 -0500, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > Christopher Petrilli wrote: > > Has anyone had any experience in storing a million or more rows in a > > SQLite3 database? I've got a database that I've been building, which > > gets 250 inserts/second, roughly, and

Re: [sqlite] Row count in database

2004-12-14 Thread Christopher Petrilli
On Tue, 14 Dec 2004 12:03:01 -0700 (MST), Ara.T.Howard <[EMAIL PROTECTED]> wrote: > On Tue, 14 Dec 2004, Christopher Petrilli wrote: > > > Has anyone had any experience in storing a million or more rows in a > > SQLite3 database? I've got a database that I've been building, which > > gets 250

Re: [sqlite] Row count in database

2004-12-14 Thread Ara.T.Howard
On Tue, 14 Dec 2004, Christopher Petrilli wrote: Has anyone had any experience in storing a million or more rows in a SQLite3 database? I've got a database that I've been building, which gets 250 inserts/second, roughly, and which has about 3M rows in it. At that point, the CPU load is huge. Note

Re: [sqlite] Row count in database

2004-12-14 Thread D. Richard Hipp
Christopher Petrilli wrote: Has anyone had any experience in storing a million or more rows in a SQLite3 database? I've got a database that I've been building, which gets 250 inserts/second, roughly, and which has about 3M rows in it. At that point, the CPU load is huge. I just ran a test case

Re: [sqlite] Row count in database

2004-12-14 Thread amead
Christopher Petrilli wrote: Has anyone had any experience in storing a million or more rows in a SQLite3 database? I've got a database that I've been building, which gets 250 inserts/second, roughly, and which has about 3M rows in it. At that point, the CPU load is huge. Note that I've got

Re: [sqlite] Row Count

2004-08-11 Thread tezozomoc
BlankConsider doing a SELECT COUNT (*) FROM db WHERE etc This should give you the number of rows before you... do the select again... Use where to match the condition. Tezo. - Original Message - From: Drew, Stephen To: '[EMAIL PROTECTED]' Sent: Wednesday, August

Re: [sqlite] Row Count

2004-08-11 Thread Derrell . Lipman
"Drew, Stephen" <[EMAIL PROTECTED]> writes: > It's not a problem if I read the whole rowset into memory and then start > sending it, but this can cause massive memory usage and time delays. It's > not such a big deal if it's not possible, I'll just have to use a Microsoft > style progress bar

RE: [sqlite] Row Count

2004-08-11 Thread Drew, Stephen
that keeps resetting). -Original Message- From: Will Leshner [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 4:46 PM To: [EMAIL PROTECTED] Subject: Re: [sqlite] Row Count On Aug 11, 2004, at 8:41 AM, Drew, Stephen wrote: > This will be a big overhead on really sm

RE: [sqlite] Row Count

2004-08-11 Thread Drew, Stephen
[mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 4:10 PM To: [EMAIL PROTECTED] Subject: Re: [sqlite] Row Count SELECT count(*) FROM Table WHERE Foo = 'bar'; Drew, Stephen wrote: > Hello, > > Is there any way to obtain the number of rows returned by a SELECT > state

Re: [sqlite] Row Count

2004-08-11 Thread Scott Baker
SELECT count(*) FROM Table WHERE Foo = 'bar'; Drew, Stephen wrote: Hello, Is there any way to obtain the number of rows returned by a SELECT statement, before receiving all the rows returned? I am using the sqlite_exec() / sqlite_step() functions to return the data, but need to populate a