On Sat, Jan 9, 2010 at 15:20, tom <toab...@googlemail.com> wrote:

> Hi Adrian,
>
> thanks for your answer!
> The problem is, that i don't know how many projects will be created.
> Every user
> of the application can create and delete new projects.
> Maybe it's possible to execute some raw sql commands whenever a
> project is created or deleted (to create the new table and insert
> trigger).
> Do you think that's possible?
> Do you have any good tutorial about postgres and partitioning? I'm
> completly new to this topic.
>
>
One possibility is to have one child table for each existing project. And
one additional table for (all) the newly created projects (just as a
temporary
step until someone or a script creates the new tables).  Later, a midnight
script can check for new projects, create the needed new tables and
rewrite the trigger(s) . I see no reason why automating everything wouldn't
be possible .

By the way : how many projects do you expect to have in the database?
Thousands of projects means thousands of tables ,  and a huge insert
trigger that tries to determine where to insert each new record.  PostgreSQL
should be able to handle lots of tables,  but that trigger will become a
bottleneck at some point in future ...

On the other hand,  try to avoid being stuck into the partitioning idea:
maybe improving the performance for your database can be done
in other ways (maybe you are simply missing an index ! ) .


Sorry, I have no links about partitioning to suggest.

However,  i suggest you to join the pgsql-performance mailing list
and ask there for advice.  That is the PostgreSQL list for discussions
about specific performance issues. You'll find information about how
to subscribe on the postgresql website .

Just make sure that you post there enough information about your database:
the columns of the table,  the estimated number of rows , and a specific
select query that is executed too slowly . And of course the execution
plan of that query  ( explain analyse select .....  from ....   where ....
).
So, make sure that you are describing a concrete problem :  for example
you didn't mention what is actual the problem that you hope to solve through
partitioning.  Obviously, you are seeking for faster database response time.
But when exactly : when you insert data, or when you query the data ?
There are many postgres experts on pgsql-performance  ,  but you need
to describe well what are you trying to do    ;)



-- 
Adrian Maier
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Reply via email to