Re: sequencer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sequencer

Sylvain Pointeau
On Fri, Aug 4, 2017 at 9:16 PM, Nico Williams <[hidden email]> wrote:

> On Fri, Aug 04, 2017 at 09:09:10PM +0200, Sylvain Pointeau wrote:
> > I programmed the currval using a temp table, but the performance dropped
> > slightly
> >
> > sqlite> WITH T(i) AS (SELECT (1)i UNION ALL SELECT i+1 FROM T WHERE
> > i<1000000) INSERT INTO seq_test(seq_num) SELECT seq_nextval('s
> > eq1') from T;
> > Run Time: real 25.837 user 23.446950 sys 0.171601
> >
> > I create the temp table only once with the help of a global variable. I
> > believe it is safe (per session), am I right?
>
> In general I would say: pthread_once() (Unix) or InitOnceExecuteOnce()
> (WIN32).  But here, a global in combination with CREATE TEMP TABLE IF
> NOT EXISTS is probably good enough.
>

I wonder if a memory structure would not be better?

kind of a fixed sized array where I would iterate to find the seq_name,
otherwise I insert it.
(or a real map but then c++ would be better in this case)

what do you think?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sequencer

Sylvain Pointeau
Dear all,

you can now find the code on github with a BSD3 license, as well as a
release providing the dll for windows

I provided a cmake file, only tested for mingw (I don't have other
compiler), I hope other will contribute to support other compilers.

Again thanks for all your support.

Best regards,
Sylvain


On Fri, Aug 4, 2017 at 10:44 PM, Sylvain Pointeau <
[hidden email]> wrote:

> You're welcome.  Thanks for posting this on github.  Make sure there's a
>> license, preferably a nice and friendly one such as a BSD license, or
>> else put it in the public domain like SQLite3 is -- but it's your code,
>> so you do what you like with it.
>>
>
> I will put a BSD license and it will be on github this week end
>
> very funny, look what I found: http://docs.oracle.com/cd/
> E17076_05/html/bdb-sql/sequencesupport.html
>
>
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: sequencer

Sylvain Pointeau
On Sun, Aug 6, 2017 at 6:34 PM, Sylvain Pointeau <[hidden email]
> wrote:

> Dear all,
>
> you can now find the code on github with a BSD3 license, as well as a
> release providing the dll for windows
>
>
forgot to add the link :-)
https://github.com/spointeau/libsequence


> I provided a cmake file, only tested for mingw (I don't have other
> compiler), I hope other will contribute to support other compilers.
>
> Again thanks for all your support.
>
> Best regards,
> Sylvain
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...