Re: [sqlite] Reading a SharePoint file

2019-11-08 Thread Jens Alfke
> On Nov 8, 2019, at 12:21 PM, Jose Isaias Cabrera wrote: > > Yeah, that is what I am doing now. I was trying to save time to just be able > to read a few tables and see if I needed to update it, so then, download it > and upload it. But now, I have to download it, and read it, and delete

Re: [sqlite] SQLite with branching

2019-11-08 Thread Bernardo Ramos
I included WAL mode and mmap on the LiteTree simple benchmark. It turns out that WAL mode is as fast as LiteTree on Linux (with a hard disk) for writes and a little slower on reads. On MacBook Pro (with SSD) LiteTree is faster on both writing and reading. SQLite's mmap make it slightly

Re: [sqlite] SQLITE_DETERMINISTIC and custom function optimization

2019-11-08 Thread Keith Medcalf
>But this makes me think of the upcoming virtual column feature. If you >define a virtual table column whose value is equal to >EXPENSIVE_FUNCTION(), do multiple references to that column in a query >cause multiple calls to the function, or is it computed only once per >row? In the present case

[sqlite] Reading a SharePoint file

2019-11-08 Thread Jose Isaias Cabrera
Is there any way that SQLite can read a file on a Sharepoint site? ie https://some.site.com/sites/ROC/Docs%20comp/Shared.Projects_DB.sqlite3 Thanks.

Re: [sqlite] Reading a SharePoint file

2019-11-08 Thread Jens Alfke
> On Nov 8, 2019, at 11:57 AM, Jose Isaias Cabrera wrote: > > Is there any way that SQLite can read a file on a Sharepoint site? ie >

Re: [sqlite] Reading a SharePoint file

2019-11-08 Thread Simon Slavin
On 8 Nov 2019, at 7:57pm, Jose Isaias Cabrera wrote: > Is there any way that SQLite can read a file on a Sharepoint site? Not without downloading it to a local drive first. You could write a Virtual File System for SQLite which handled files on a Sharepoint site. But it would be difficult

Re: [sqlite] SQLITE_DETERMINISTIC and custom function optimization

2019-11-08 Thread Jens Alfke
> On Nov 8, 2019, at 11:08 AM, Mario M. Westphal wrote: > > The EXPENSIVE_FUNCTION function is referred multiple times in the update > statement. But it always returns the same result (for any given row). There was a similar thread (that I started, I think) from two years ago with subject

Re: [sqlite] Reading a SharePoint file

2019-11-08 Thread Jose Isaias Cabrera
Jens Alfke, on Friday, November 8, 2019 03:25 PM, wrote... > > On Nov 8, 2019, at 12:21 PM, Jose Isaias Cabrera, on > > > > Yeah, that is what I am doing now. I was trying to save time [clip] > SharePoint might support WebDAV, and most OSs support (or used to support) > mounting > WebDAV as a

Re: [sqlite] Reading a SharePoint file

2019-11-08 Thread Jose Isaias Cabrera
Jose Isaias Cabrera, on Friday, November 8, 2019 03:32 PM, wrote... > > Jens Alfke, on Friday, November 8, 2019 03:25 PM, wrote... > > > > On Nov 8, 2019, at 12:21 PM, Jose Isaias Cabrera, on > > > > > > Yeah, that is what I am doing now. I was trying to save time > [clip] > > SharePoint might

Re: [sqlite] SQLITE_DETERMINISTIC and custom function optimization

2019-11-08 Thread Simon Slavin
On 8 Nov 2019, at 7:08pm, Mario M. Westphal wrote: > The query looks like this: Try using EXPLAIN QUERY PLAN on your query. You might be able to see the two places where your function is called. ___ sqlite-users

Re: [sqlite] Reading a SharePoint file

2019-11-08 Thread Jose Isaias Cabrera
Simon Slavin, on Friday, November 8, 2019 03:15 PM, wrote... > > On 8 Nov 2019, at 7:57pm, Jose Isaias Cabrera, on > > > Is there any way that SQLite can read a file on a Sharepoint site? > > Not without downloading it to a local drive first. Thanks, Simon.

Re: [sqlite] SQLITE_DETERMINISTIC and custom function optimization

2019-11-08 Thread Keith Medcalf
I meant of course the following -- "result" is really ef in the where clause ... with t(rowid, ef) as ( select distinct rowid, expensive_function(?99, vdata) from some_table ), u(rowid, vdist, oid, flags) as ( select some_table.rowid,

[sqlite] SQLITE_DETERMINISTIC and custom function optimization

2019-11-08 Thread Mario M. Westphal
Hi all, I have a table with matrices stored as blobs. Each matrix has about 800 bytes. This table has between 20,000 and 500,000 rows. I use a custom function "EXPENSIVE_FUNCTION" which performs a calculation using a matrix supplied via sqlite3_bind_pointer() as ?99 and the matrix in the

Re: [sqlite] Deterministic random sampling via SELECT

2019-11-08 Thread Merijn Verstraaten
On 7 Nov 2019, at 20:47, Chris Peachment wrote: > 1. generate a list of pseudo-random numbers, using a pre-defined > seed value, over the range 1 .. count(*) of records in table, > > 2. use that list as record id values to select the desired subset > of the data in the table. > > This

Re: [sqlite] SQLITE_DETERMINISTIC and custom function optimization

2019-11-08 Thread Keith Medcalf
SQLITE_DETERMINISTIC does not mean that the function is only called once for each unique set of arguments, only that when called with a unique set of arguments that it returns the same result. This means that if it is a constant it can be factored out of being called more than once. In your

Re: [sqlite] Reading a SharePoint file

2019-11-08 Thread Jose Isaias Cabrera
Jens Alfke, on Friday, November 8, 2019 03:16 PM, wrote... > > > On Nov 8, 2019, at 11:57 AM, Jose Isaias Cabrera, on > > > > Is there any way that SQLite can read a file on a Sharepoint site? > > Download the file over HTTP and then open the local file with SQLite, is the > obvious answer.

Re: [sqlite] database disk image is malformed

2019-11-08 Thread Jukka Marin
On Thu, Nov 07, 2019 at 09:26:46AM -0800, Shawn Wagner wrote: > This line stood out: > > > The main process opens the databases and then forks the other processes > which can then perform database operations using the already opened > databases. > > From >

Re: [sqlite] Feature request: (VALUES (1), (2), (3)) AS t(n)

2019-11-08 Thread Ainar Garipov
(Hopefully this works.) > How about something like: > > with t(a, b) as (values (1, 1), (2, 2)) select a, b from t; Yeah, CTEs are an obvious alternative. I mostly request this AS t(n) feature because I have had some otherwise-portable PostgreSQL queries that I needed to tweak for SQLite. The