You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit 07/02 : ticket commencé, mais pas encore fini, compter encore une ou deux 1/2 journée (je crains d'avoir fait le + facile)
Principales sources de ces erreurs :
Pages besoin
Soupçon : un omnisearch trop gourmand ? (le referer indique dans tous les cas vus un paramètre omnisearch)
-> revoir la configuration de pg_search pour Need
adding a pre-calculated ts_vector column that is automatically written on each INSERT/UPDATE, adding an index to use the new column
1 Materialized Views
Materialized views are essentially SQL queries whose results can be cached to a table, indexed, and periodically refreshed when desired.
One option would be to cache the tsvectors using a materialized view.
Materialized views may be a good option for your data.
One downside is that the entire view must be refreshed with:
REFRESH MATERIALIZED VIEW view_name;
That may be a good fit in some scenarios, perhaps run daily as a cron or Scheduler job.
2. Update tsvector with a trigger and cache result
implique de changer le format du schéma => Since we can’t dump a tsvector column to schema.rb, we need to switch to the SQL schema format in our config/application.rb: config.active_record.schema_format = :sql (plus de db/schema.rb)
Edit 07/02 : ticket commencé, mais pas encore fini, compter encore une ou deux 1/2 journée (je crains d'avoir fait le + facile)
Principales sources de ces erreurs :
Pages besoin
Soupçon : un omnisearch trop gourmand ? (le referer indique dans tous les cas vus un paramètre
omnisearch
)-> revoir la configuration de
pg_search
pourNeed
Peut-être aussi un pb de N+1. Cf sentry :
ou
/app/app/models/user.rb in is_admin? at line 282
Ressources
Pg_search
Ts vector ?
adding a pre-calculated ts_vector column that is automatically written on each INSERT/UPDATE, adding an index to use the new column
1 Materialized Views
Materialized views are essentially SQL queries whose results can be cached to a table, indexed, and periodically refreshed when desired.
One option would be to cache the tsvectors using a materialized view.
Materialized views may be a good option for your data.
One downside is that the entire view must be refreshed with:
That may be a good fit in some scenarios, perhaps run daily as a cron or Scheduler job.
2. Update tsvector with a trigger and cache result
config.active_record.schema_format = :sql
(plus dedb/schema.rb
)3. Index !
https://caspg.com/blog/optimizing-full-text-search-with-postgres-materialized-view-in-rails
scenic
https://web.archive.org/web/20150329002818/http://altoros.github.io/2013/implementing-and-improving-postgresql-fulltext-search/
https://pganalyze.com/blog/full-text-search-ruby-rails-postgres
https://github.com/Casecommons/pg_search/wiki/Building-indexes
https://thoughtbot.com/blog/optimizing-full-text-search-with-postgres-tsvector-columns-and-triggers
gin
)https://hybrd.co/posts/full-text-search-in-postgres-with-view-backed-models-in-rails
scenic
The text was updated successfully, but these errors were encountered: