Обсуждение: NEED HELP !

Поиск
Список
Период
Сортировка

NEED HELP !

От
Sergej Galkin
Дата:
Hello all,

I am a student-magister and I'm writting my magister work. I realized gist index TPR tree - it is like a simple R tree but moving :)
Everything is compiling ok, I creating table and index, but after whese code - DB is restarting :(((

set enable_seqscan = false
select * from table_of_moving_objects where mov_obj ~ box '(0,0) (1,1)'


I can not understand why DB is restarting ? It is restarting when SQL begins use index :(((
Can anybody help me , I would by appretiate every people who downloads my sources, try to deploy index and maybe solve where is the problem.

Best regards,
Sergej Galkin
Вложения

Re: NEED HELP !

От
Sergej Galkin
Дата:
I want to add than I have a piece of my code that looks very strange <br /><br /><div style="margin-left: 80px;">Datum
gist_mov_penalty(PG_FUNCTION_ARGS)<br/>{<br />    GISTENTRY *origentry = (GISTENTRY *) PG_GETARG_POINTER(0);<br />    
GISTENTRY*newentry  = (GISTENTRY *) PG_GETARG_POINTER(1);<br />    float * result = (float *) PG_GETARG_POINTER(2);<br
/><b>    moving_object *orig =  &(*origentry).key;<br />    make_now(orig);<br />    moving_object *new =
&(*origentry).key;<br/>     make_now(new);</b><br /><br /><br /><br /></div><div style="margin-left: 40px;">Is
everythingok in this code ??<br /><br /></div><br /><div class="gmail_quote">On Wed, Jan 13, 2010 at 8:42 PM, Sergej
Galkin<span dir="ltr"><<a href="mailto:sergej.galkin@gmail.com">sergej.galkin@gmail.com</a>></span> wrote:<br
/><blockquoteclass="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex;
padding-left:1ex;">Hello all,<br /><br />I am a student-magister and I'm writting my magister work. I realized gist
indexTPR tree - it is like a simple R tree but moving :)<br /> Everything is compiling ok, I creating table and index,
butafter whese code - DB is restarting :(((<br /><b><br /></b><div style="margin-left: 40px;"><i>set enable_seqscan =
false<br/>select * from table_of_moving_objects where mov_obj ~ box '(0,0) (1,1)'</i><br /></div><br />I can not
understandwhy DB is restarting ? It is restarting when SQL begins use index :(((<br /> Can anybody help me , I would by
appretiateevery people who downloads my sources, try to deploy index and maybe solve where is the problem.<br /><br
/>Bestregards,<br /><font color="#888888">Sergej Galkin<br /></font></blockquote></div><br /> 

Re: TPR-tree crash WAS: NEED HELP !

От
Josh Berkus
Дата:
Sergej,

> I can not understand why DB is restarting ? It is restarting when SQL
> begins use index :(((
> Can anybody help me , I would by appretiate every people who downloads
> my sources, try to deploy index and maybe solve where is the problem.

It would help if you gave people a link.

Also, if you are Russian, there is a siginficant community of PostgreSQL
russian-speakers who might be able to help you.

--Josh Berkus


Re: NEED HELP !

От
Robert Haas
Дата:
On Wed, Jan 13, 2010 at 1:42 PM, Sergej Galkin <sergej.galkin@gmail.com> wrote:
> I can not understand why DB is restarting ? It is restarting when SQL begins
> use index :(((
> Can anybody help me , I would by appretiate every people who downloads my
> sources, try to deploy index and maybe solve where is the problem.

Your code is probably crashing.  Before trying to use the index, run
"select pg_backend_pid()" in the backend that you're going to try to
use it from.  Then use "gdb -p <pid>" to attach gdb to the backend.
Type "c" for continue.  Now run the query that crashes it.  gdb will
trap the signal and you can use "bt" to get a backtrace.

I don't think it would be appropriate for us to help you debug your
class project, but learning to use gdb should help you a lot.

Also see:

http://wiki.postgresql.org/wiki/Guide_to_reporting_problems

...Robert


Re: NEED HELP !

От
Sergej Galkin
Дата:
I debugged index with gdb and  found that it is segmentation fault in my procedure named <b>gist_mov_consistent</b> it
isonly 7 lines. So I think it is worth to publish it to public, <br /><br /><i><br /></i> <i>Datum
gist_mov_consistent(PG_FUNCTION_ARGS)</i><br/><i>{</i><br /><i>    GISTENTRY *entry = (GISTENTRY
*)PG_GETARG_POINTER(0);</i><br/><i>    BOX *query = PG_GETARG_BOX_P(1);</i><br /><i>    StrategyNumber strategy =
(StrategyNumber)PG_GETARG_UINT16(2);</i><br/><i>    </i><br /><i>    if (DatumGetMovP(entry->key) == NULL || query
==NULL)</i><br /><i>        PG_RETURN_BOOL(FALSE);</i><br /><i>    </i><br /><i>   
PG_RETURN_BOOL(obj_contains(DatumGetMovP(entry->key),query));</i><br /><i>}</i><br /><br />Do you have any ideas
whereis the problem ? :)<br /><br />Best regards,<br />Sergej Galkin<br /><br /><div class="gmail_quote">On Wed, Jan
13,2010 at 8:42 PM, Sergej Galkin <span dir="ltr"><<a
href="mailto:sergej.galkin@gmail.com">sergej.galkin@gmail.com</a>></span>wrote:<br /><blockquote class="gmail_quote"
style="border-left:1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello all,<br /><br />I
ama student-magister and I'm writting my magister work. I realized gist index TPR tree - it is like a simple R tree but
moving:)<br /> Everything is compiling ok, I creating table and index, but after whese code - DB is restarting :(((<br
/><b><br/></b><div style="margin-left: 40px;"><i>set enable_seqscan = false<br />select * from table_of_moving_objects
wheremov_obj ~ box '(0,0) (1,1)'</i><br /></div><div class="im"><br />I can not understand why DB is restarting ? It is
restartingwhen SQL begins use index :(((<br /> Can anybody help me , I would by appretiate every people who downloads
mysources, try to deploy index and maybe solve where is the problem.<br /><br /></div>Best regards,<br /><font
color="#888888">SergejGalkin<br /></font></blockquote></div><br /> 

Re: NEED HELP !

От
Sergej Galkin
Дата:
And
int obj_contains(moving_object *a, BOX *b)
{
   
    if (b->low.x > a->x_low)
        return 0;
    if (b->low.y > a->y_low)
        return 0;
    if (b->high.x < a->x_high)
        return 0;
    if (b->high.y < a->y_high)
        return 0;
    return 1;
}

this is the procedure obj contains

On Wed, Jan 13, 2010 at 8:56 PM, Sergej Galkin <sergej.galkin@gmail.com> wrote:
I want to add than I have a piece of my code that looks very strange

Datum gist_mov_penalty(PG_FUNCTION_ARGS)
{
    GISTENTRY *origentry = (GISTENTRY *) PG_GETARG_POINTER(0);
    GISTENTRY *newentry  = (GISTENTRY *) PG_GETARG_POINTER(1);
    float * result = (float *) PG_GETARG_POINTER(2);
     moving_object *orig =  &(*origentry).key;
    make_now(orig);
    moving_object *new = &(*origentry).key;
    make_now(new);




Is everything ok in this code ??


On Wed, Jan 13, 2010 at 8:42 PM, Sergej Galkin <sergej.galkin@gmail.com> wrote:
Hello all,

I am a student-magister and I'm writting my magister work. I realized gist index TPR tree - it is like a simple R tree but moving :)
Everything is compiling ok, I creating table and index, but after whese code - DB is restarting :(((

set enable_seqscan = false
select * from table_of_moving_objects where mov_obj ~ box '(0,0) (1,1)'


I can not understand why DB is restarting ? It is restarting when SQL begins use index :(((
Can anybody help me , I would by appretiate every people who downloads my sources, try to deploy index and maybe solve where is the problem.

Best regards,
Sergej Galkin