Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>1- Is it normal that it is so long for this index to build?</p> </blockquote> <p>No.</p> <p>This is on my postgres 9.0 server which runs on single-core AMD Athlon 64 3700+:</p> <pre><code>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 </code></pre> <p>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).</p> <p>Turning text documents into tsvector and building a GIN (or GIST) index is CPU-intensive.</p> <p>I don't know exact specs of heroku ronin in terms of CPU power. Can you tell us what it compares to?</p> <p>Performance of index building is also very sensitive to <a href="http://www.postgresql.org/docs/current/static/runtime-config-resource.html#GUC-MAINTENANCE-WORK-MEM" rel="nofollow"><code>maintenance_work_mem</code></a> setting. Memory needed (and size of the index) depends on input data, might be from 20% to 150% of input data size.</p> <blockquote> <p>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.</p> </blockquote> <p>Unfortunately, no. PostgreSQL does not have this kind of "introspection". </p> <p>You could create same index on a 10% sample and multiply to estimate.</p> <blockquote> <p>3- What about my approach. </p> </blockquote> <p>Nothing bad - it is OK, at last if PostgreSQL has built-in FTS, it's good to begin with.</p> <p>But if you need faster solution (both indexing time and searching speed) - the only way is to go out of database. External solutions like <a href="http://sphinxsearch.com/docs/current.html" rel="nofollow">Sphinx</a> or <a href="http://lucene.apache.org/core/" rel="nofollow">Lucene</a> are faster (10x from my experience).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload