Quantcast

explicit indices - not generated

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

explicit indices - not generated

Tim Pigden

I have the following mapping declared within my site domain. But it does not result in the generation of an index. Is it expected to? Or do I have to create it myself?

 

    static mapping = {

        cache usage: 'nonstrict-read-write'

        columns {

            siteCode index:'site_code_index'

        }

    }

 

Thanks

 

Tim Pigden

Optrak Distribution Software Limited

Orland House

Mead Lane

Hertford

SG13 7AT

Tel: 01992 517100

www.optrak.co.uk

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: explicit indices - not generated

Tim Pigden

I’ve tried setting the dialect and it doesn’t make any difference. If I manually create the index, will hibernate use it or might the whole thing be a bit broken? And changing the DSL to specify the column name, still with no luck. Shall I create a Jira?

            siteCode column: 'site_codes', index:'site_code_index'

 

From: Tim Pigden [mailto:[hidden email]]
Sent: 07 December 2007 17:15
To: [hidden email]
Subject: [grails-user] explicit indices - not generated

 

I have the following mapping declared within my site domain. But it does not result in the generation of an index. Is it expected to? Or do I have to create it myself?

 

    static mapping = {

        cache usage: 'nonstrict-read-write'

        columns {

            siteCode index:'site_code_index'

        }

    }

 

Thanks

 

Tim Pigden

Optrak Distribution Software Limited

Orland House

Mead Lane

Hertford

SG13 7AT

Tel: 01992 517100

www.optrak.co.uk

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: explicit indices - not generated

Christian Laakmann
Hi Tim,

this sounds like a bug to me.

However, as a workaround, you can create your index manually - it's the Database System itself and not Hibernate that uses the index to boost performance.

Apart from creation, Hibernate doesn't care about indexes at all.

Greets
Christian

tim pigden wrote
I've tried setting the dialect and it doesn't make any difference. If I
manually create the index, will hibernate use it or might the whole
thing be a bit broken? And changing the DSL to specify the column name,
still with no luck. Shall I create a Jira?

            siteCode column: 'site_codes', index:'site_code_index'

 

From: Tim Pigden [mailto:tim.pigden@optrak.co.uk]
Sent: 07 December 2007 17:15
To: user@grails.codehaus.org
Subject: [grails-user] explicit indices - not generated

 

I have the following mapping declared within my site domain. But it does
not result in the generation of an index. Is it expected to? Or do I
have to create it myself?

 

    static mapping = {

        cache usage: 'nonstrict-read-write'

        columns {

            siteCode index:'site_code_index'

        }

    }

 

Thanks

 

Tim Pigden

Optrak Distribution Software Limited

Orland House

Mead Lane

Hertford

SG13 7AT

Tel: 01992 517100

www.optrak.co.uk

 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: explicit indices - not generated

Tim Pigden
In reply to this post by Tim Pigden
Well that certainly helps. However, if hibernate doesn't know about
index, doesn't that make every search through the cache linear, and
doesn't that mean that it may be more efficient to query the database
than the cache?

-----Original Message-----
From: Christian Laakmann [mailto:[hidden email]]
Sent: 07 December 2007 17:53
To: [hidden email]
Subject: RE: [grails-user] explicit indices - not generated


Hi Tim,

this sounds like a bug to me.

However, as a workaround, you can create your index manually - it's the
Database System itself and not Hibernate that uses the index to boost
performance.

Apart from creation, Hibernate doesn't care about indexes at all.

Greets
Christian


tim pigden wrote:
>
> I've tried setting the dialect and it doesn't make any difference. If
I
> manually create the index, will hibernate use it or might the whole
> thing be a bit broken? And changing the DSL to specify the column
name,

> still with no luck. Shall I create a Jira?
>
>             siteCode column: 'site_codes', index:'site_code_index'
>
>  
>
> From: Tim Pigden [mailto:[hidden email]]
> Sent: 07 December 2007 17:15
> To: [hidden email]
> Subject: [grails-user] explicit indices - not generated
>
>  
>
> I have the following mapping declared within my site domain. But it
does

> not result in the generation of an index. Is it expected to? Or do I
> have to create it myself?
>
>  
>
>     static mapping = {
>
>         cache usage: 'nonstrict-read-write'
>
>         columns {
>
>             siteCode index:'site_code_index'
>
>         }
>
>     }
>
>  
>
> Thanks
>
>  
>
> Tim Pigden
>
> Optrak Distribution Software Limited
>
> Orland House
>
> Mead Lane
>
> Hertford
>
> SG13 7AT
>
> Tel: 01992 517100
>
> www.optrak.co.uk
>
>  
>
>
>

--
View this message in context:
http://www.nabble.com/explicit-indices---not-generated-tf4963326.html#a1
4217334
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: explicit indices - not generated

Tim Pigden
In reply to this post by Tim Pigden
Spent half an hour trying to generate a jira test case, but it does
generate the index. So not sure what's going on but haven't time to
investigate further.

-----Original Message-----
From: Christian Laakmann [mailto:[hidden email]]
Sent: 07 December 2007 17:53
To: [hidden email]
Subject: RE: [grails-user] explicit indices - not generated


Hi Tim,

this sounds like a bug to me.

However, as a workaround, you can create your index manually - it's the
Database System itself and not Hibernate that uses the index to boost
performance.

Apart from creation, Hibernate doesn't care about indexes at all.

Greets
Christian


tim pigden wrote:
>
> I've tried setting the dialect and it doesn't make any difference. If
I
> manually create the index, will hibernate use it or might the whole
> thing be a bit broken? And changing the DSL to specify the column
name,

> still with no luck. Shall I create a Jira?
>
>             siteCode column: 'site_codes', index:'site_code_index'
>
>  
>
> From: Tim Pigden [mailto:[hidden email]]
> Sent: 07 December 2007 17:15
> To: [hidden email]
> Subject: [grails-user] explicit indices - not generated
>
>  
>
> I have the following mapping declared within my site domain. But it
does

> not result in the generation of an index. Is it expected to? Or do I
> have to create it myself?
>
>  
>
>     static mapping = {
>
>         cache usage: 'nonstrict-read-write'
>
>         columns {
>
>             siteCode index:'site_code_index'
>
>         }
>
>     }
>
>  
>
> Thanks
>
>  
>
> Tim Pigden
>
> Optrak Distribution Software Limited
>
> Orland House
>
> Mead Lane
>
> Hertford
>
> SG13 7AT
>
> Tel: 01992 517100
>
> www.optrak.co.uk
>
>  
>
>
>

--
View this message in context:
http://www.nabble.com/explicit-indices---not-generated-tf4963326.html#a1
4217334
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: explicit indices - not generated

Bruce Cota
I've had exactly the same observation, btw (my indexes don't
get created), but I haven't had a chance to look into it enough
to make a Jira.  

Just so you don't feel alone :)

-Bruce

Tim Pigden wrote:

>Spent half an hour trying to generate a jira test case, but it does
>generate the index. So not sure what's going on but haven't time to
>investigate further.
>
>-----Original Message-----
>From: Christian Laakmann [mailto:[hidden email]]
>Sent: 07 December 2007 17:53
>To: [hidden email]
>Subject: RE: [grails-user] explicit indices - not generated
>
>
>Hi Tim,
>
>this sounds like a bug to me.
>
>However, as a workaround, you can create your index manually - it's the
>Database System itself and not Hibernate that uses the index to boost
>performance.
>
>Apart from creation, Hibernate doesn't care about indexes at all.
>
>Greets
>Christian
>
>
>tim pigden wrote:
>  
>
>>I've tried setting the dialect and it doesn't make any difference. If
>>    
>>
>I
>  
>
>>manually create the index, will hibernate use it or might the whole
>>thing be a bit broken? And changing the DSL to specify the column
>>    
>>
>name,
>  
>
>>still with no luck. Shall I create a Jira?
>>
>>            siteCode column: 'site_codes', index:'site_code_index'
>>
>>
>>
>>From: Tim Pigden [mailto:[hidden email]]
>>Sent: 07 December 2007 17:15
>>To: [hidden email]
>>Subject: [grails-user] explicit indices - not generated
>>
>>
>>
>>I have the following mapping declared within my site domain. But it
>>    
>>
>does
>  
>
>>not result in the generation of an index. Is it expected to? Or do I
>>have to create it myself?
>>
>>
>>
>>    static mapping = {
>>
>>        cache usage: 'nonstrict-read-write'
>>
>>        columns {
>>
>>            siteCode index:'site_code_index'
>>
>>        }
>>
>>    }
>>
>>
>>
>>Thanks
>>
>>
>>
>>Tim Pigden
>>
>>Optrak Distribution Software Limited
>>
>>Orland House
>>
>>Mead Lane
>>
>>Hertford
>>
>>SG13 7AT
>>
>>Tel: 01992 517100
>>
>>www.optrak.co.uk
>>
>>
>>
>>
>>
>>    
>>
>
>  
>


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: explicit indices - not generated

Christian Laakmann
In reply to this post by Tim Pigden
I don't know whether or not I understand you question right, but:

indices and the level-1/2 and query caches are not linked in any way.

Any query you send to hibernate will be checked against the query cache. Should the query-cache contain an entry for the query, a set of ids is returned which tells Hibernate to try an get the objects belonging to these ids from the cache, or, if not possible from the DB itself.

The database-index on the other hand is, if you like, some kind of cache on the database which replicates the data of the index-column and re-orders/sorts it, so the table entries may be found faster.

These explanations may not be completely exact, but that's more or less how it works. See here for in depth information in the Hibernate docs: http://www.hibernate.org/hib_docs/v3/reference/en/html/performance.html#performance-cache

Most of the times it is more efficient for Hibernate to query the cache, as all the cached information are available in memory - whereas with a query sent to the database, the query has to be executed and the resulting database rows have to be transformed into POJ/GOs.

Greets
Christian

tim pigden wrote
Well that certainly helps. However, if hibernate doesn't know about
index, doesn't that make every search through the cache linear, and
doesn't that mean that it may be more efficient to query the database
than the cache?

-----Original Message-----
From: Christian Laakmann [mailto:clxris@gmail.com]
Sent: 07 December 2007 17:53
To: user@grails.codehaus.org
Subject: RE: [grails-user] explicit indices - not generated


Hi Tim,

this sounds like a bug to me.

However, as a workaround, you can create your index manually - it's the
Database System itself and not Hibernate that uses the index to boost
performance.

Apart from creation, Hibernate doesn't care about indexes at all.

Greets
Christian


tim pigden wrote:
>
> I've tried setting the dialect and it doesn't make any difference. If
I
> manually create the index, will hibernate use it or might the whole
> thing be a bit broken? And changing the DSL to specify the column
name,
> still with no luck. Shall I create a Jira?
>
>             siteCode column: 'site_codes', index:'site_code_index'
>
>  
>
> From: Tim Pigden [mailto:tim.pigden@optrak.co.uk]
> Sent: 07 December 2007 17:15
> To: user@grails.codehaus.org
> Subject: [grails-user] explicit indices - not generated
>
>  
>
> I have the following mapping declared within my site domain. But it
does
> not result in the generation of an index. Is it expected to? Or do I
> have to create it myself?
>
>  
>
>     static mapping = {
>
>         cache usage: 'nonstrict-read-write'
>
>         columns {
>
>             siteCode index:'site_code_index'
>
>         }
>
>     }
>
>  
>
> Thanks
>
>  
>
> Tim Pigden
>
> Optrak Distribution Software Limited
>
> Orland House
>
> Mead Lane
>
> Hertford
>
> SG13 7AT
>
> Tel: 01992 517100
>
> www.optrak.co.uk
>
>  
>
>
>

--
View this message in context:
http://www.nabble.com/explicit-indices---not-generated-tf4963326.html#a1
4217334
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: explicit indices - not generated

Christian Laakmann
In reply to this post by Tim Pigden
tried a

grails clear

?

tim pigden wrote
Spent half an hour trying to generate a jira test case, but it does
generate the index. So not sure what's going on but haven't time to
investigate further.

-----Original Message-----
From: Christian Laakmann [mailto:clxris@gmail.com]
Sent: 07 December 2007 17:53
To: user@grails.codehaus.org
Subject: RE: [grails-user] explicit indices - not generated


Hi Tim,

this sounds like a bug to me.

However, as a workaround, you can create your index manually - it's the
Database System itself and not Hibernate that uses the index to boost
performance.

Apart from creation, Hibernate doesn't care about indexes at all.

Greets
Christian


tim pigden wrote:
>
> I've tried setting the dialect and it doesn't make any difference. If
I
> manually create the index, will hibernate use it or might the whole
> thing be a bit broken? And changing the DSL to specify the column
name,
> still with no luck. Shall I create a Jira?
>
>             siteCode column: 'site_codes', index:'site_code_index'
>
>  
>
> From: Tim Pigden [mailto:tim.pigden@optrak.co.uk]
> Sent: 07 December 2007 17:15
> To: user@grails.codehaus.org
> Subject: [grails-user] explicit indices - not generated
>
>  
>
> I have the following mapping declared within my site domain. But it
does
> not result in the generation of an index. Is it expected to? Or do I
> have to create it myself?
>
>  
>
>     static mapping = {
>
>         cache usage: 'nonstrict-read-write'
>
>         columns {
>
>             siteCode index:'site_code_index'
>
>         }
>
>     }
>
>  
>
> Thanks
>
>  
>
> Tim Pigden
>
> Optrak Distribution Software Limited
>
> Orland House
>
> Mead Lane
>
> Hertford
>
> SG13 7AT
>
> Tel: 01992 517100
>
> www.optrak.co.uk
>
>  
>
>
>

--
View this message in context:
http://www.nabble.com/explicit-indices---not-generated-tf4963326.html#a1
4217334
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email
Loading...