> pretty quickly, so if you need testing input (Django 3.2, Postgres) I
> can offer feedback from what I find.

Yes testing would be awesome, esp. for edge cases (test coverage for default cases is pretty complete for `fast_update` I think).

> Can you tell me more about this statement:
>  > *Note* copy_update will probably never leave the alpha/PoC-state, as
> psycopg3 brings great COPY support, which does a more secure value
> conversion and has a very fast C-version.

Well I created the `copy_update` alternative for postgres just to see the advantage of COPY FROM over UPDATE FROM VALUES. The impl uses psycopg2's COPY interface, which got heavily revamped in psycopg3, including proper value adapters written C. V2 does not have this yet, therefore I had to create the value encoders in python, which are less strict about values and still ~3 times slower than the C adapters in psycopg3. The message above is meant as a warning, that I dont plan to put too much effort into polishing this soon outdated implementation.

> Where can I learn more about that COPY statement, and how/where that
> statement might be integrated with the Django ORM?

Plz check the postgres docs (https://www.postgresql.org/docs/current/sql-copy.html), it covers all important low level details. Furthermore check psycopg3 docs (and also psycopg2 docs, if you want to get your hands on the `copy__update` impl). I dont think that driving `bulk_update` by COPY FROM for postgres is a good idea, there are quite some semantic differences, also it is slower for tiny changesets than UPDATE FROM VALUES, thought it starts to shine for changesets >1000 (up to ~4 times faster for a 1M changeset compared to `fast_update` in my tests). Maybe it can be added to the postgres subpackage, if there is demand for it.

Feel free to create issues or to comment on open ones. Important pending issues are: - proper duplicate check (https://github.com/netzkolchose/django-fast-update/issues/13) - good story whether to integrate support for f-expressions back or to keep them out (currently unsupported, as the steps to get this working are very cumbersome)

Cheers,
Jerch

--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/4a765e10-a829-720f-1795-82ae5a1dc88d%40netzkolchose.de.

Reply via email to