I am optimizing the search query in the Postgres database. The query uses the unaccent function. I want to create a gin-index to make the search query faster. So I had gone through some articles on faking the stable function as an immutable function using wrapper functions. I was thinking of creating a new column for precomputed unaccented texts would be good. But I got to know that the unaccent function can produce different outputs. So what is the preferred way? Precomputation or using a wrapper function to deceive the program?
Why unaccent function in Postgres is a stable function? Will the precomputation in column produce the different outputs?
260 Views Asked by Krunal Goswami At
1
There are 1 best solutions below
Related Questions in POSTGRESQL
- Only the first SQL script gets executed inside Docker Postgres container
- Compare fields in two tables
- Hibernate ClobJdbcType bindings: what are the diferences?
- Postgres && statement Error in Mybatis Mapper?
- Can this query be optimized? (Choosing a random row to insert, that excludes previously inserted Rows)
- Connection terminated unexpectedly while performing multi row insert using pg-promise
- Processing multiple forms in nodejs and postgresql
- How to copy data from SQLite to postgreSQL?
- PGAdmin4 configured behind a reverse proxy but unable to connect to Postgresql server
- Updates to pgsodium encrypted values don't use specified key_id
- Connecting to Postgres running in a Docker container using psql
- Can't connect to local postgresql server from my docker container
- Django Arrayfield migration to cloud sql (Postgresql) not creating the column
- Get list of matching keywords for each post
- docker-compose can't reset postgresql database
Related Questions in INDEXING
- How to give index id to my uploaded json file in FastAPI?
- operator class "gin_trgm_ops" does not exist for access method "gin"
- what is it? my question is what's the meaning of img[img]
- If composite indexing created - indexing is called?
- Autocomplete not working for apache spark in java vscode
- Pyside6, tableView.selectedIndexes, list index out of range
- Indexing in ServiceNow Jelly Report not working
- Wordpress | Page indexing Page is not indexed: Redirect error
- Why does my attempt to print the index of my array ALWAYS return 0.00?
- jQuery - Click and enable Button without affecting other foreach Laravel arrays
- std:array indexing and operator[]
- ChartJS indexing for datapoints
- How to make Postgres GIN index work with jsonb_* functions?
- Using Closing Stock Balance as Opening Stock in subsequent line item
- Using MYSQL optimise table with innodb_optimize_fulltext_only and innodb_ft_num_word_optimize options, how do I know when it's finished?
Related Questions in QUERY-OPTIMIZATION
- mysql query takes too long because of wrong indexes usage
- plan_handle is always different for each query in SQL Server Cache
- Is there an indexing strategy in Postgres which will operate effectively for JOINs with ORs
- IS NULL performance issue in MySQL
- How to optimize query which has or in left join clause?
- Not equal vs IN in AWS Redshift
- Optimize MySQL query perform ORDER BY before JOIN
- SQL Query to fetch final data for hierarchal configuration tables in a single query
- getting mysql deadlock because this query is taking to long
- Substring search optimization in mysql
- what happen when a materialized is too large in postgres
- Improve insert when normalizing database in PostgreSQL
- How can I make the MySQL table searching executed faster?
- MongoDB - Update a field based on another field within the same doc in the array
- Swiss Scheduling System for Ping-Pong league
Related Questions in PSQL
- Postgres && statement Error in Mybatis Mapper?
- Connecting to Postgres running in a Docker container using psql
- how to use system's environnement variables in sql script
- Postgres not listing operators and functions
- Postgresql Auto Update Column
- PSQL given a table with cols id, name, date return id whose most recent date is with name 'John'
- How to properly insert elements into a table using PSQL SQL SHELL
- psql environment variable for sslkey password?
- I cannot COMMIT inside a procedure
- How to PSQL query for jsonb column with nested array to contain string
- Java Runtime.exec fails to execute psql command
- How can I automatically populate a newly added column that references a foreign key?
- PSQL: add case / if statement to `returning` statement
- Switch user in a .SQL for postgresql
- current_setting with -v option
Related Questions in UNACCENT
- "UndefinedFunction: function unaccent_schema.unaccent(unknown, text) does not exist" while run any restored database in odoo
- Alternatives to `asciifolding` filter for removing Greek ascents from unicode text
- How to unaccent special characters in PySpark?
- Why unaccent function in Postgres is a stable function? Will the precomputation in column produce the different outputs?
- Using unaccent with two different rules
- How to make diacritics insensitive queries in PostgreSQL, without unaccent extension?
- BigQuery UDF to remove accents/diacritics in a string
- Unaccent() function alternative in TEIID
- Use unaccent postgres extension in Knex.js Querys
- UNACCENT when checking for UNIQUE contraint violations in PostgreSQL
- Python UDF function in Redshift always return NULL value
- Store custom files on heroku postgres database
- How to programatically unaccent pandas dataframe header
- Postgresql levenshtein and precomposed character vs. combined character
- Use unaccent PostgreSQL function within Laravel Eloquent Query
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can read this Postgres doc about unaccent extension, in my opinion, there are two cases :
1- Add slug columns to tables :
Pros :
Cons :
Redundant data, almost if you need to implement multi-criteria searching, in this case you should create a slug(without diacritic signs) for all concerned columns
Update columns mean update all concerned slug columns
Create data migrations for the existing database with automated slug creation using Slugify for instance.
2- Use unaccent extension
Pros :
Cons :