How can I create Indexes using Entities in Google's Data Store

30 views
Skip to first unread message

rahul kumar

unread,
Aug 26, 2009, 11:30:08 PM8/26/09
to Google App Engine
Hello Techies

I want to create Indexes using Google' Datastore Api so that when I am
saving my entities,I can be able to create & get Indexes also to make
it easy for my application to search Data.

How can I achieve this.

Please help

thanks
Rahul Kumar
Message has been deleted

rahul kumar

unread,
Aug 28, 2009, 12:09:12 AM8/28/09
to google-a...@googlegroups.com
Thanks Jai

But I am getting index of all the attributes of Entity despite of the fact that I haven't created any, neither on attributes nor explicitly through XML

Right now I have lesser Data so Its hard to judge where the query processing is fast or not but when the data is in millions will it work?

thanks in advance but please guide me.

On Fri, Aug 28, 2009 at 12:36 AM, Jai <shar...@gmail.com> wrote:

HI Rahul,

All the properties of an entity with indexed=true are automatically
indexed by the default indexes. You can define custom indexes other
than the default indexes in the index.yaml app configuration file as
specified here:
http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Defining_Indexes_With_Configuration

Regards,
Jai



--
_ _ _ _ _ _ _ _ _ _

Thanks & Regards

Rahul Kumar
[09891362429]

Tim Hoffman

unread,
Aug 28, 2009, 3:05:38 AM8/28/09
to Google App Engine
Hi

I found out earlier you can query what indexes exist, but you can't
create them through the api (even though the call exists) at least in
the the python sdk

Have a look at this thread

http://groups.google.com.au/group/google-appengine/browse_thread/thread/9c2cd22c992866e4/48230163d090815f?q=#48230163d090815f

Rgds

Tim

rahul kumar

unread,
Aug 28, 2009, 4:52:37 AM8/28/09
to google-a...@googlegroups.com
Hi Tim

But I am using this through java API. I have the Data & Ported it with & without index but I am getting index on all the attributes & dont know whether it will work or not on Million records to get faster result through query.

Wooble

unread,
Aug 28, 2009, 9:21:54 AM8/28/09
to Google App Engine
Most individual attributes are indexed automatically unless you
specify otherwise (I believe the only exceptions are the equivalent's
of the python SDK's TextProperty and BlobProperty). The indexing
scales fine; the only real issue with having unneeded indexes for the
properties of millions of entities is the space it takes to store
them. There's a cost at write time as well, but the marginal cost of
updating indexes for any one entity is fairly small unless you have an
exploding index problem, which is only going to occur with composite
indexes anyway.

BTW, the indexes don't help you get "faster results for a query";
without an index you get no results at all. Unlike most RMDBSes, you
can't choose to filter queries based on unidexed properties and just
live with the incredible slowness of scanning the whole table. You
get fast queries or none at all.

On Aug 28, 4:52 am, Rahul Kumar <rahul.k...@gmail.com> wrote:
> Hi Tim
>
> But I am using this through java API. I have the Data & Ported it with &
> without index but I am getting index on all the attributes & dont know
> whether it will work or not on Million records to get faster result through
> query.
>
>
>
> On Fri, Aug 28, 2009 at 12:35 PM, Tim Hoffman <zutes...@gmail.com> wrote:
>
> > Hi
>
> > I found out earlier you can query what indexes exist, but you can't
> > create them through the api (even though the call exists) at least in
> > the the python sdk
>
> > Have a look at this thread
>
> >http://groups.google.com.au/group/google-appengine/browse_thread/thre...

Jai

unread,
Aug 28, 2009, 9:28:51 AM8/28/09
to Google App Engine
Hi Rahul,

If you want to turn off indexing then you can use indexed = False, on
the attributes which you don't want to index explicitly, because the
default value is indexed = True for any attribute type except db.Text
and db.Blob, which are not indexed by default.

Though having an index increases the write time, it's the only way of
guaranteeing that your entity can be found using a particular
attribute.

Regards,
Jai



On Aug 28, 4:52 am, Rahul Kumar <rahul.k...@gmail.com> wrote:
> Hi Tim
>
> But I am using this through java API. I have the Data & Ported it with &
> without index but I am getting index on all the attributes & dont know
> whether it will work or not on Million records to get faster result through
> query.
>
>
>
> On Fri, Aug 28, 2009 at 12:35 PM, Tim Hoffman <zutes...@gmail.com> wrote:
>
> > Hi
>
> > I found out earlier you can query what indexes exist, but you can't
> > create them through the api (even though the call exists) at least in
> > the the python sdk
>
> > Have a look at this thread
>
> >http://groups.google.com.au/group/google-appengine/browse_thread/thre...
Reply all
Reply to author
Forward
0 new messages