U
U
un1t2016-09-08 18:24:09
PostgreSQL
un1t, 2016-09-08 18:24:09

How to use Postgres functional indexes from Django?

There are functional indexes
in postgres Viewer doc:
https://docs.djangoproject.com/es/1.10/ref/contrib...
There seems to be nothing like that.
Is there an app for this?
Now it only comes to mind to write a raw query in the migration, but this is some kind of terrible crutch.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Kitaev, 2016-09-08
@un1t

Dzhanga does not have the ability to:
Specify the index type (HASH, BTREE, BRIN, GIN, GIST). BTREE only.
Create functional indexes
Create partial indexes
Only crutch pure SQL in migrations.

X
xSkyFoXx, 2016-09-08
@xSkyFoXx

This is not a crutch, but quite an adequate solution.
Query optimization and indexes are the database side.
It's perfectly fine to go ahead and create indexes on the table/columns that your application uses the most. Actually, this is why such a profession as a database administrator lives and thrives.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question