Csaba Nagy wrote:

> This could be a solution... but then I'm not sure how well would do
> queries which need the first 10 records based on some criteria which
> does not include the group id. I guess limit queries across the union of
> the partitions don't work too well for now, and we do have such queries.
> I'm pretty sure we could work this out, but it would need some big
> refactoring of our current code which is not that simple... and it must
> work well with oracle too. We do have systems on Oracle too.

No, it wouldn't, because the partitioning logic can live in the
database.  You don't need to touch the application.

I agree that those queries not using the group criteria could put you in
some sort of trouble.  But if you exchange one big indexscan by several
smaller indexscans, maybe it's not that bad.  Even less if you stop
scanning (because of the LIMIT) before you used all the partitions.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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

Reply via email to