Re: NEED HELP !

Lists: pgsql-hackers
From: Sergej Galkin <sergej(dot)galkin(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: NEED HELP !
Date: 2010-01-13 18:42:22
Message-ID: dfebc1f11001131042o421b04ecq941e107df09d10bc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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

Attachment Content-Type Size
moving_object.rar application/octet-stream 5.1 KB

From: Sergej Galkin <sergej(dot)galkin(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: NEED HELP !
Date: 2010-01-13 18:56:25
Message-ID: dfebc1f11001131056m139a2ab5pabe21e6717346082@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(dot)galkin(at)gmail(dot)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
>


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Sergej Galkin <sergej(dot)galkin(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: TPR-tree crash WAS: NEED HELP !
Date: 2010-01-13 19:05:20
Message-ID: 4B4E1970.1030602@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Sergej Galkin <sergej(dot)galkin(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: NEED HELP !
Date: 2010-01-13 19:21:32
Message-ID: 603c8f071001131121o4f827b2cn174bc1f4e14e20a9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jan 13, 2010 at 1:42 PM, Sergej Galkin <sergej(dot)galkin(at)gmail(dot)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


From: Sergej Galkin <sergej(dot)galkin(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: NEED HELP !
Date: 2010-01-13 19:43:03
Message-ID: dfebc1f11001131143r70023b63mfe6b621e00c0aeee@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I debugged index with gdb and found that it is segmentation fault in my
procedure named *gist_mov_consistent* it is only 7 lines. So I think it is
worth to publish it to public,

*
* *Datum gist_mov_consistent(PG_FUNCTION_ARGS)*
*{*
* GISTENTRY *entry = (GISTENTRY *)PG_GETARG_POINTER(0);*
* BOX *query = PG_GETARG_BOX_P(1);*
* StrategyNumber strategy = (StrategyNumber)PG_GETARG_UINT16(2);*
* *
* if (DatumGetMovP(entry->key) == NULL || query == NULL)*
* PG_RETURN_BOOL(FALSE);*
* *
* PG_RETURN_BOOL(obj_contains(DatumGetMovP(entry->key), query));*
*}*

Do you have any ideas where is the problem ? :)

Best regards,
Sergej Galkin

On Wed, Jan 13, 2010 at 8:42 PM, Sergej Galkin <sergej(dot)galkin(at)gmail(dot)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
>


From: Sergej Galkin <sergej(dot)galkin(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: NEED HELP !
Date: 2010-01-13 19:46:22
Message-ID: dfebc1f11001131146o2cf28d38p22dad636ad8802f3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(dot)galkin(at)gmail(dot)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(dot)galkin(at)gmail(dot)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
>>
>
>