News for hackers. Stuff that matters.
Re:Hctree is an experimental high-concurrency database back ... by rcarmo on Wednesday January 18, 2023 @06:47PM (#34434802)
Lack of JSON CONTAINS would be a good reason.
Re:Hctree is an experimental high-concurrency database back ... by TkTech on Wednesday January 18, 2023 @06:55PM (#34434860)
Heh, this is the reason Takahe is currently broken on SQLite. Hashtags currently need a JSON contains.
Re:Hctree is an experimental high-concurrency database back ... by simonw on Wednesday January 18, 2023 @09:05PM (#34435874)
It's possible to simulate JSON contains in SQLite using a devious subselect.

Here's an example:

https://datasette.io/content/plugin_repos?_facet_array=tags&...

That page shows every row where the tags column (a SQLite JSON list of strings) contains the string "Data Import"

Here's the underlying SQL:

https://datasette.io/content?sql=select%0D%0A++rowid%2C%0D%0...

    select
      rowid,
      repo,
      tags
    from
      plugin_repos
    where
      :tag in (
        select
          value
        from
          json_each(plugin_repos.tags)
      )
    order by
      rowid
    limit
      101
I haven't tried it yet, but I have a strong hunch that this could be dramatically accelerated using a join against a FTS table on that "tags" column in order to first filter the rows down to a likely subset.
Re:Hctree is an experimental high-concurrency database back ... by rcarmo on Thursday January 19, 2023 @02:08AM (#34437535)
Django would need to be patched to do that, since the default SQLite provider would make it hard to do that cleanly.

Here’s the relevant Takahe issue: https://github.com/jointakahe/takahe/issues/325

Re:Hctree is an experimental high-concurrency database back ... by rcarmo on Thursday January 19, 2023 @02:06AM (#34437519)
Yep. That’s exactly what I stumbled upon myself.
Re:Hctree is an experimental high-concurrency database back ... by blacklion on Thursday January 19, 2023 @05:21AM (#34438727)
Do these developers, who require JSON CONTAINS, know about basic normal forms and RDBMS in general?!

I understand, that sometimes for performance it is needed to de-normalize huge datalakes, but typical website controlled by CMS is not huge by any means.