Indexing too slow?

235 views
Skip to first unread message

fahrio

unread,
Sep 4, 2009, 8:39:21 AM9/4/09
to Thinking Sphinx
I am new to thinking sphinx and it's taking too long to index my
database.
I currently have 16 works and I am indexing work.name, work.info,
work.credited_users.name and work.credited_titles.name. Sphinx is
taking around 37mins to index 16 works. And I can't imagine how long
it will take when I deploy my project and the number of works
increase.

Am I doing something wrong?

my Work model looks like this:

has_many :credits, :dependent => :destroy
has_many :credited_users, :through => :credits, :source => "user"
has_many :credited_titles, :through => :credits, :source =>
"title"

define_index do
indexes :name
indexes info
indexes credited_users.name, :as => :credited_user_name
indexes credited_titles.name, :as => :credited_title_name
end

I am working on a MacBook 2.4GHz Core 2 Duo with 2GB RAM

Here is my indexing stats:

Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew Aksyonoff

using config file '/Users/.../config/development.sphinx.conf'...
indexing index 'work_core'...
collected 16 docs, 0.0 MB
collected 0 attr values
sorted 0.0 Mvalues, 100.0% done
sorted 0.0 Mhits, 100.0% done
total 16 docs, 1820 bytes
total 2228.265 sec, 0.82 bytes/sec, 0.01 docs/sec
distributed index 'work' can not be directly indexed; skipping.

Pat Allan

unread,
Sep 4, 2009, 9:18:54 AM9/4/09
to thinkin...@googlegroups.com
Hi Fahrio

Are you using fixtures for your data? The way Rails generates ids
slows down Sphinx significantly (indeed, it should be a matter of
seconds for 16 records).
Have a look at the second topic on this page:
http://freelancing-god.github.com/ts/en/common_issues.html

--
Pat

fahrio

unread,
Sep 5, 2009, 6:12:19 PM9/5/09
to Thinking Sphinx
Thanks for the info Pat, I am using fixtures indeed.

Fahri
> > Copyright (c)2001-2008, Andrew Aksyonoff
Reply all
Reply to author
Forward
0 new messages