On Feb 11, 2008 1:53 PM, Dennis Cote <[EMAIL PROTECTED]> wrote:
>
> Stephen Oberholtzer wrote:
> > I should note that there's a gross inefficiency when using triggers to
> > handle updates or deletes against views; SQLite does the equivalent of
> > this:
> >
> > For UPDATE <view> ...  WHERE <condition>,  SQLite copies the entire
> > source view into the temp table.
> >
> > SELECT * INTO <temptable> FROM <view>
> >
> > Then, it iterates over <temptable>, looking for rows that match
> > <condition>, and *then* runs the trigger on them.  This means that if
> > your source view is large, this will run slowly.
> >
> > I submitted a patch a long while ago to optimize this by turning the
> > initial temp-table population into "SELECT * INTO <temptable> FROM
> > <view> WHERE <condition>", which worked much faster, but I don't think
> > anything came of it.
> >
> > (my original msg to this list:
> > http://readlist.com/lists/sqlite.org/sqlite-users/2/11029.html )
> >
> >
> >
>
> Stephen,
>
> This does seem like a good idea.
>
> The SQLite mailing list doesn't pass files attached to submissions, so
> no one saw your patch. I would suggest creating at ticket at
> http://www.sqlite.org/cvstrac/captcha?nxp=/cvstrac/tktnew and posting
> your message, or a link to it, along with your patch.
>
> I suspect the patch itself will probably have to be modified, since
> SQLite recently underwent significant changes to its code generation
> routines.
>
> As with all patches, it will be reviewed and accepted much faster if it
> passes the test suite.
>
>
> HTH
> Dennis Cote

If only you'd been around when I'd posted my message! Nobody said
*anything*, so I figured nobody else cared about it.

I have reposted my mailing list message, with attachments, here:
http://www.sqlite.org/cvstrac/tktview?tn=2938

I have not updated the patch, however.  It *should* be pretty
straightforward -- looking at it again, it doesn't actually seem to do
any VDBE code itself, so who knows?

-- 
-- Stevie-O
Real programmers use COPY CON PROGRAM.EXE
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to