Search Postgresql Archives
ltree and ordering - what index?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: PostgreSQL General <pgsql-general@xxxxxxxxxxxxxx>
- Subject: ltree and ordering - what index?
- From: hubert depesz lubaczewski <depesz@xxxxxxxxx>
- Date: Sat, 17 Sep 2005 13:31:21 +0200
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=FxXKs8q+l95y2x7rP9J2IHqIBJz6lmF6Ho7It567gK59+fuSaIpmyu/zCHk4KieoaPERaWwmCbfwZx0ZJHfqJoTk2eE5jyjWckorfLMy4MKfEVfvFbqqgKRxRMmJK6k78bJUGeP0joPlgqrWj8CD3APYxc9QHTVqzNylIjQo3VU=
- Reply-to: depesz@xxxxxxxxx
- Sender: pgsql-general-owner@xxxxxxxxxxxxxx
hi
i have a table with more or less this structure:
id (serial)
category (ltree)
region (ltree[])
price (integer)
title (text)
entered (timestamptz)
now.
i would like to be able to search by region and category, but order using price, title or entered.
previous design was quite simple:
id (serial)
category (integer)
region (integer)
price (integer)
title (text)
entered (timestamptz)
and then having index on category, region, price allowed me to do:
select * from table where category = xxx and region = yyy order by category, region, price limit 10;
which worked blazingly fast.
but what do i do when i store category and region information as ltrees?
what indices to use? how to build a query?
any help?
any more information i should give?
we're yusing postgresql 8.0.3 (and thinking about thinking about testing 8.1beta).
depesz
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]
[Postgresql Jobs]
[Postgresql Admin]
[Postgresql Performance]
[Linux Clusters]
[PHP Home]
[PHP on Windows]
[Kernel Newbies]
[PHP Classes]
[PHP Books]
[PHP Databases]
[Postgresql & PHP]
[Yosemite]