Re: [HACKERS] Advices on custom data type and extension development

2016-01-19 Thread Alvaro Herrera
Luciano Coutinho Barcellos wrote: > * the type would be 8 bytes long, being 4 dedicated to storing the > Date, and 4 dedicated to storing a serial within that day; Another thing to consider -- have you carefully defined what the "current day" is? This might sound a stupid question, but a

Re: [HACKERS] Advices on custom data type and extension development

2016-01-19 Thread Corey Huinker
> > Seriously, you should consider having a primary key with two > columns, of type date and int. It would take exactly the same > space as your current plan, and performance should be very close to > what you propose. As long as you aren't using some ORM that is too > dumb to deal with this, it

Re: [HACKERS] Advices on custom data type and extension development

2016-01-19 Thread Kevin Grittner
On Mon, Jan 18, 2016 at 9:36 PM, Luciano Coutinho Barcellos wrote: > * a lot of data being generated every day, which are mainly queried > by an immutable column of type date or timestamp; > * as a standard, almost every table has a bigserial id column as a > primary key; >

[HACKERS] Advices on custom data type and extension development

2016-01-18 Thread Luciano Coutinho Barcellos
Dear friends, I'm planning to develop an extension, and I'm here for getting some help. But I would like to share the problem I intend to solve. Maybe my desired solution is not a good option. What I have: * a lot of data being generated every day, which are mainly queried b