Spatial in own indexes?

97 views
Skip to first unread message

ZNS

unread,
Feb 21, 2012, 9:25:43 AM2/21/12
to ravendb
Hello,

I have an index that has items with lat and long-itude. I have added
spatialindex to it for searching within a radius. However it's
probably only 10% of the queries against the index that are going to
be spatial. Is it recommended to create a separate index for spatial
queries then? Will it effect performance on the other 90% of the
queries?

Matt Warren

unread,
Feb 21, 2012, 11:13:38 AM2/21/12
to rav...@googlegroups.com
The advice has always been, fewer, larger indexes have better perf that lots of smaller ones.

So I'd create one large index that covers all the fields you need and then do the different queries against it.

Tobi

unread,
Feb 22, 2012, 9:44:39 AM2/22/12
to rav...@googlegroups.com
On 21.02.2012 17:13, Matt Warren wrote:

> The advice has always been, fewer, larger indexes have better perf that
> lots of smaller ones.

I thought it might be a good idea to test this from time to time, so I
just ran my old test program for this again:

100 Indexes with a single property each: 00:05:08
1 Index with 100 properties : 00:02:01

This is actually better than older RavenDB version, but the advice to use
few larger indexes is still valid.

Tobias

Matt Warren

unread,
Feb 22, 2012, 10:18:35 AM2/22/12
to rav...@googlegroups.com
Tobi

Thanks for re-running those tests, it's nice to know I'm still giving people the correct info!!

Just out of interest, how many docs were there in Raven when you ran this? And do you know it there is more or less of a different in the timings when you have a larger amount of docs?

Tobi

unread,
Feb 22, 2012, 11:40:06 AM2/22/12
to rav...@googlegroups.com
On 22.02.2012 16:18, Matt Warren wrote:

> Just out of interest, how many docs were there in Raven when you ran this?

00:05:08 vs. 00:02:01 was for 25.600 docs (each having 100 string
properties filled with guids).

> And do you know it there is more or less of a different in the timings
> when you have a larger amount of docs?

For 128.000 docs it's:

00:27:45 vs. 00:09:55

Tobias

Matt Warren

unread,
Feb 22, 2012, 12:44:28 PM2/22/12
to rav...@googlegroups.com
Thanks again for doing that.

Itamar Syn-Hershko

unread,
Feb 22, 2012, 1:33:54 PM2/22/12
to rav...@googlegroups.com
Did any of those had spatial field in it?

Tobi

unread,
Feb 22, 2012, 3:36:04 PM2/22/12
to rav...@googlegroups.com
On 22.02.2012 19:33, Itamar Syn-Hershko wrote:

> Did any of those had spatial field in it?

No. Only simple string fields. Spatial fields shouldn't make much of a
difference for writes to the DB. They are just mapped as
longitude/latitude somehow in order to allow Lucene to do distance
queries, aren't they?

Tobias

Itamar Syn-Hershko

unread,
Feb 22, 2012, 5:03:11 PM2/22/12
to rav...@googlegroups.com
Yes, I was wondering how much that takes. Shouldn't be much.

ambatikr

unread,
Feb 23, 2012, 3:10:14 AM2/23/12
to rav...@googlegroups.com
Hi,

Replication is not working for me.

Steps I did was:

1. Installed RavenDB in two servers say "Server1" and "Server2" as service option.
2. Created a Plugins directory under Server directory in "Server1" and copied raven.replication.dll from bundles directory to this Plugins directory.
3. Added the following in "Server1".
 under system document Raven/Replication/Destinations
{
  "Destinations": [
    {
      "Url": "http://server2:8081"
    }
  ],
  "Id": "Raven/Replication/Destinations"
}


So when I try to create new a document in "Server1" its not replicating to "Server2". Please let me know if I am doing anything wrong.

Regards
Kasi

Oren Eini (Ayende Rahien)

unread,
Feb 23, 2012, 3:11:55 AM2/23/12
to rav...@googlegroups.com
Why the double post?
Reply all
Reply to author
Forward
0 new messages