assorted problems with intarray and other GiST contribs.

From: PFC <lists(at)boutiquenumerique(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Cc: teodor(at)sigaev(dot)ru, oleg(at)sai(dot)msu(dot)su
Subject: assorted problems with intarray and other GiST contribs.
Date: 2005-06-26 16:48:42
Message-ID: op.sszkzgnith1vuj@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hello !

I'm using postgresql 8.0.1-r2 on gentoo linux.
So, here are the problems :

************************************
* int_array_aggregate crashes

SELECT int_array_aggregate(id) FROM (SELECT id FROM shop.products LIMIT X)
as foo;

This one works fine if X <= 512 and crashes postgres if X > 512.
ie. if the aggregate accumulates more than 512 values it crashes.

On another example query :

SELECT int_array_aggregate(product_id),
int_array_aggregate(category_id)
FROM (SELECT * FROM shop.products_to_categories LIMIT N) as foo;

OK if N <= 8, crashes if N > 9

************************************
* integer[] intersection is slow

int[] & int[] - returns intersection of arrays

This is a useful function but it is very slow.
Computing the intersection of two int[] of length 100 takes about 40 ms.
in Python for instance, computing a similar intersection takes about 0.1
millisecond, including building both arrays, converting them to sets, and
computing the set intersection.
Maybe some information can be extracted from the Python souce code.

************************************
* ltree

First of all congratulations for this extremely useful datatype and
assorted indexes, it really rocks and makes SQL tree handling from
nightmare to fun.

It would be nice to have functions to :
- know the length of a ltree (ie. number of elements)
- access it like an array (ie. get element N).
This is to be able to iterate over the elements and fetch each of them to
get the list of rows which make up a path upto a given object in my tree.

Also a function returning the comon prefix between two ltrees would be
really useful.

Thanks and sorry to come bother you !
Regards,
PF Caillaud

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Oleg Bartunov 2005-06-26 17:41:51 Re: assorted problems with intarray and other GiST contribs.
Previous Message PFC 2005-06-26 16:25:40 Re: people who buy A, also buy C, D, E