django-postges-lookups-any:提供= ANY(ARRAY(xxx))而不是IN(xxx)

时间:2021-02-09 04:40:05
【文件属性】:
文件名称:django-postges-lookups-any:提供= ANY(ARRAY(xxx))而不是IN(xxx)
文件大小:31KB
文件格式:ZIP
更新时间:2021-02-09 04:40:05
Python django-postgres查找任何 提供= ANY(ARRAY(xxx))而不是IN(xxx) 文献资料 该库是为Postgres设计的。 当Postgres不使用带有长IN()语句的索引时,它使开发人员能够解决问题。 通常,当您尝试执行查询时: SELECT a. * FROM a WHERE a . id NOT IN ( SELECT b . id FROM b ) 您希望它将在a.id上使用索引。 不幸的是,它不起作用。 有一种技巧可以使Postgres通过重写查询来做到这一点: SELECT a. * FROM a WHERE a . id = ANY(ARRAY( SELECT b . id FROM b)) 该库允许您使用此语句。 例子: """ SELECT * FROM mymodel WHERE somefield=ANY([1, 2, 3]
【文件预览】:
django-postges-lookups-any-main
----django_postges_lookups_any()
--------admin.py(25B)
--------lookups.py(2KB)
--------models.py(42B)
--------test_utils()
--------urls.py(251B)
--------__init__.py(22B)
--------apps.py(144B)
--------views.py(0B)
----.gitignore(425B)
----setup.cfg(262B)
----manage.py(329B)
----README.rst(2KB)
----.github()
--------ISSUE_TEMPLATE.md(356B)
----tests()
--------README.md(664B)
--------test_models.py(2KB)
--------settings.py(3KB)
--------urls.py(313B)
--------__init__.py(0B)
--------requirements.txt(90B)
--------wsgi.py(389B)
----CONTRIBUTING.rst(3KB)
----docs()
--------make.bat(6KB)
--------contributing.rst(33B)
--------conf.py(8KB)
--------installation.rst(248B)
--------index.rst(458B)
--------history.rst(28B)
--------authors.rst(28B)
--------usage.rst(522B)
--------readme.rst(27B)
--------Makefile(7KB)
----LICENSE(1KB)
----HISTORY.rst(97B)
----docker-compose.yaml(224B)
----pytest.ini(159B)
----.coveragerc(146B)
----tasks.py(2KB)
----requirements.txt(9B)
----requirements_test.txt(181B)
----MANIFEST.in(194B)
----setup.py(2KB)
----.travis.yml(553B)
----.editorconfig(331B)
----tox.ini(451B)
----AUTHORS.rst(166B)
----requirements_dev.txt(34B)

网友评论