New pre-release snapshot with performance enhancements

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

New pre-release snapshot with performance enhancements

Richard Hipp-3
There is a new pre-release snapshot of SQLite up at
https://www.sqlite.org/download.html

Change notes can be seen at https://www.sqlite.org/draft/releaselog/3_17_0.html

The performance enhancements in the R-Tree extension are of particular
significance.  If you are able to test out this pre-release snapshot
in your application, please do so and report results to this mailing
list, or directly to me.  Thanks.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: New pre-release snapshot with performance enhancements

Jake
Hello Richard,

Is the following enhancement included as part of this pre-release snapshot?

- Enhance the session extension to support WITHOUT ROWID tables.

The draft documentation still says that this support does not yet exist,
and my test below also demonstrates this. Please let me know if I am
missing something.

/*
** The following function will print an error as expected: "UNIQUE
constraint failed: a.x".
**
** If table a is WITHOUT ROWID, then there will be no error.
*/
void fn(void){
  sqlite3 *db;
  sqlite3_session *pSession = 0;
  int nChangeset;
  void *pChangeset;
  char *sql;
  char *zMsg;

  sqlite3_open(":memory:", &db);

  sql = "CREATE TABLE a(x PRIMARY KEY) --WITHOUT ROWID";
  sqlite3_exec(db, sql, NULL, NULL, NULL);

  sqlite3session_create(db, "main", &pSession);
  sqlite3session_attach(pSession, "a");

  sql = "INSERT INTO a VALUES (1)";
  sqlite3_exec(db, sql, NULL, NULL, NULL);

  sqlite3session_changeset(pSession, &nChangeset, &pChangeset);

  sql = "DELETE FROM a WHERE x=1";
  sqlite3_exec(db, sql, NULL, NULL, NULL);

  sqlite3changeset_apply(db, nChangeset, pChangeset, 0, 0, 0);

  sql = "INSERT INTO a VALUES (1)";
  sqlite3_exec(db, sql, NULL, NULL, &zMsg);
  if( zMsg ) printf("%s\n", zMsg);
}

/*****************************************/

Kind Regards

Jake

On Sun, Feb 5, 2017 at 2:23 AM, Richard Hipp <[hidden email]> wrote:

> There is a new pre-release snapshot of SQLite up at
> https://www.sqlite.org/download.html
>
> Change notes can be seen at https://www.sqlite.org/draft/
> releaselog/3_17_0.html
>
> The performance enhancements in the R-Tree extension are of particular
> significance.  If you are able to test out this pre-release snapshot
> in your application, please do so and report results to this mailing
> list, or directly to me.  Thanks.
>
> --
> D. Richard Hipp
> [hidden email]
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: New pre-release snapshot with performance enhancements

Dan Kennedy-4
On 02/07/2017 05:14 PM, Jake Thaw wrote:
> Hello Richard,
>
> Is the following enhancement included as part of this pre-release snapshot?
>
> - Enhance the session extension to support WITHOUT ROWID tables.
>
> The draft documentation still says that this support does not yet exist,
> and my test below also demonstrates this. Please let me know if I am
> missing something.

Hi Jake,

Maybe you accidentally linked against the wrong version of SQLite or
something. It's working here. The code I used is below. It is the same
as yours except that:

   * prints the SQLite version to stdout, and
   * includes a dummy conflict handler. Technically the conflict handler
argument to sqlite3changeset_apply may not be NULL, although it wouldn't
cause your test to fail.

Dan.

/****************************************************************/

#include <sqlite3.h>
#include <stdio.h>

static int xConflict(
   void *pCtx,
   int eConf,
   sqlite3_changeset_iter *pIter
){
   return SQLITE_CHANGESET_ABORT;
}

/*
** The following function will print an error as expected: "UNIQUE
** constraint failed: a.x".
**
** If table a is WITHOUT ROWID, then there will be no error.
*/
void fn(void){
   sqlite3 *db;
   sqlite3_session *pSession = 0;
   int nChangeset;
   void *pChangeset;
   char *sql;
   char *zMsg;

   printf("Using SQLite %s\n", sqlite3_libversion());

   sqlite3_open(":memory:", &db);

   sql = "CREATE TABLE a(x PRIMARY KEY) --WITHOUT ROWID";
   sqlite3_exec(db, sql, NULL, NULL, NULL);

   sqlite3session_create(db, "main", &pSession);
   sqlite3session_attach(pSession, "a");

   sql = "INSERT INTO a VALUES (1)";
   sqlite3_exec(db, sql, NULL, NULL, NULL);

   sqlite3session_changeset(pSession, &nChangeset, &pChangeset);

   sql = "DELETE FROM a WHERE x=1";
   sqlite3_exec(db, sql, NULL, NULL, NULL);

   sqlite3changeset_apply(db, nChangeset, pChangeset, 0, xConflict, 0);

   sql = "INSERT INTO a VALUES (1)";
   sqlite3_exec(db, sql, NULL, NULL, &zMsg);
   if( zMsg ) printf("%s\n", zMsg);
}

int main(int argc, char **argv){
   fn();
   return 0;
}

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: New pre-release snapshot with performance enhancements

Dan Kennedy-4
On 02/07/2017 09:38 PM, Dan Kennedy wrote:

> On 02/07/2017 05:14 PM, Jake Thaw wrote:
>> Hello Richard,
>>
>> Is the following enhancement included as part of this pre-release
>> snapshot?
>>
>> - Enhance the session extension to support WITHOUT ROWID tables.
>>
>> The draft documentation still says that this support does not yet exist,
>> and my test below also demonstrates this. Please let me know if I am
>> missing something.
>
> Hi Jake,
>
> Maybe you accidentally linked against the wrong version of SQLite or
> something. It's working here.

>   sql = "CREATE TABLE a(x PRIMARY KEY) --WITHOUT ROWID";

As the email was being sent I noticed the -- in the above. But it works
here with or without that.

Dan.


_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: New pre-release snapshot with performance enhancements

Jake
Hi Dan,

I can confirm that the current snapshot works for me as expected. I was
linking against sqlite-snapshot-201701170010, which predates the session
enhancement.

Thank you for your time.

-Jake
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users