Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7509671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:59:12+00:00 2026-05-29T22:59:12+00:00

I have an Ruby on Rails 3 Heroku application, which needs to perform text

  • 0

I have an Ruby on Rails 3 Heroku application, which needs to perform text search on a few models. Each models have a large datasets, and that dataset is expected to grow considerably.

I want to be able to do fast text search on columns like title and description. Simple queries, like give me all Articles having “postgresql” (case insensitive) in their title, or body. I need multilingual capability too.

Currently, my DB is not being used in production, and I’m using the Ronin plan, which gives a dedicated db using PostgreSQL.

In order to do that, I decided to go with a plugin call texticle. That plugin allows full text search using PostgreSQL capability. However, it did not work smoothly, and I decided to build full text indexes.

I ran the following query, on a table with 15 millions entries. 20 hours later, it is still running.

create index on articles using gin(to_tsvector('english', title));

My questions :

1- Is it normal that it is so long for this index to build?

2- Is there any way to find out the status of that index build-up? It doesn’t show yet in my indexes usage table.

3- What about my approach. Am I looking at this the wrongway? Would you have other recommendations? I would like to keep my budget low for now, but be able to easily migrate to an effective production quality solution when needs arise, a scalable one.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:59:13+00:00Added an answer on May 29, 2026 at 10:59 pm

    1- Is it normal that it is so long for this index to build?

    No.

    This is on my postgres 9.0 server which runs on single-core AMD Athlon 64 3700+:

    filip@filip=# create table articles as select i, md5('the ' || random()::text || ' feds took my ' || random()::text ) as title from generate_series(1,15000000) i;
    SELECT 15000000
    Time: 91851.97 ms
    filip@filip=# create index on articles using gin(to_tsvector('english', title));
    CREATE INDEX
    Time: 340802.395 ms
    

    As you can see, on building GIN index on 15 Mrows took 340 seconds (BTW, table size was 977 MB and index size was 319 MB).

    Turning text documents into tsvector and building a GIN (or GIST) index is CPU-intensive.

    I don’t know exact specs of heroku ronin in terms of CPU power. Can you tell us what it compares to?

    Performance of index building is also very sensitive to maintenance_work_mem setting. Memory needed (and size of the index) depends on input data, might be from 20% to 150% of input data size.

    2- Is there any way to find out the status of that index build-up? It
    doesn’t show yet in my indexes usage table.

    Unfortunately, no. PostgreSQL does not have this kind of “introspection”.

    You could create same index on a 10% sample and multiply to estimate.

    3- What about my approach.

    Nothing bad – it is OK, at last if PostgreSQL has built-in FTS, it’s good to begin with.

    But if you need faster solution (both indexing time and searching speed) – the only way is to go out of database. External solutions like Sphinx or Lucene are faster (10x from my experience).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ruby on rails application and it would be nice to see
I have a ruby on rails app running a server and sometimes it needs
I have a simple Ruby on Rails form which includes an authenticity_token. Unfortunatly, I
I have set up a staging instance of a rails 3.1 application on Heroku
I have a Ruby on Rails app that needs process many background jobs simultaneously:
I have deployed a Rails application on Heroku (web-server thin). When I push it,
Is it feasible to have a Ruby on Rails app, which is: a) deployed
I deployed a Ruby on Rails app to Heroku, and I realized they have
I have a Ruby on Rails application that has two active environments, Stage and
I'm using Ruby on Rails 3 deployed at heroku. Now I have working fine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.