Connecting Tech Pros Worldwide Forums | Help | Site Map

How to remove CLUSTERs and 'partitioning tables'

Gabriele Bartolini
Guest
 
Posts: n/a
#1: Nov 11 '05
Hi guys,

just a quick and probably stupid question. When I make a cluster
based on an index on a table, how can I remove it later? Should I
'create' a new one by using the primary key index?

Also, can I have more than 1 cluster on my table? Let me explain ...
can I put for instance the record with, let's say, age between 10 and 20
on a specific cluster, from 20 to 30 on another one, and so on?

Thank you
-Gabriele



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly


Christopher Browne
Guest
 
Posts: n/a
#2: Nov 11 '05

re: How to remove CLUSTERs and 'partitioning tables'


After a long battle with technology,gbartolini@optusnet.com.au (Gabriele Bartolini), an earthling, wrote:[color=blue]
> just a quick and probably stupid question. When I make a cluster
> based on an index on a table, how can I remove it later? Should I
> 'create' a new one by using the primary key index?[/color]

There are two options:

1. If there is something more relevant to cluster on, you might
cluster on that instead.

2. If there is nothing relevant to cluster on, then you could leave
it alone.

In either case, as _further_ changes are made to the table, the
clustering is likely to lose its effect as new entries will not
necessarily be made in the order the clustering indicates.
[color=blue]
> Also, can I have more than 1 cluster on my table? Let me explain
> ... can I put for instance the record with, let's say, age between
> 10 and 20 on a specific cluster, from 20 to 30 on another one, and
> so on?[/color]

No, that idea doesn't make much sense.

CLUSTER reorganizes the table base based an index that you select.
You get to pick one index.

Mind you, if you created a functional index, you might get something
sort of like this.

I'm not sure of the ideal syntax for this, but let's say you made up
an index:

create index age_clusters on tbl1 (round(age, -1));

(Which might or might not resemble how you'd round AGE to the nearest
10 :-)).

Cluster on that index and you might get the desired result. But the
point is that you need to be able to express it as ONE index, not as 5
of them...
--
(reverse (concatenate 'string "gro.gultn" "@" "enworbbc"))
http://www3.sympatico.ca/cbbrowne/
Rule of Scarcity
"If it's not allocated by a market, then it's more expensive than
money."
-- Mark Miller
Carmen Gloria Sepulveda Dedes
Guest
 
Posts: n/a
#3: Nov 11 '05

re: How to remove CLUSTERs and 'partitioning tables'


Hello.

At the site http://www.postgresql.org/docs/7.3/static/lo-libpq.html there is a description to manipulate
binary data with libpq. How can I do the same but with ECPG?

Thanks.


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Closed Thread


Similar PostgreSQL Database bytes