[HACKERS] BRIN indexes for MAX, MIN, ORDER BY?

2015-09-27 Thread Gavin Wahl
It seems trivial to accelerate a MAX or MIN query with a BRIN index. You just find the page range with the largest/smallest value, and then only scan that one. Would that be hard to implement? I'm interested in working on it if someone can give me some pointers. Somewhat harder but still possible

Re: [HACKERS] BRIN indexes for MAX, MIN, ORDER BY?

2015-09-27 Thread Gavin Wahl
> Yeah. I would urgently recommend that people *not* try to build new > things like planagg.c right now. A large part of the point of upper > planner path-ification is to have a less grotty way of dealing with > things like specialized aggregate implementations. Ok. I will wait and ask again

Re: [HACKERS] Proposed feature: Selective Foreign Keys

2013-12-19 Thread Gavin Wahl
This a great solution to this problem, one I've found to be very common in web development. The technique will work to add RI to Django's generic foreign keys[1], which are implemented with an id column and a type-flag column. [1]: