bitset counting as a user defined function in postgresql 9.2? - Mailing list pgsql-hackers

From Kanarupan Kularatnarajah
Subject bitset counting as a user defined function in postgresql 9.2?
Date
Msg-id CAFf4ZT2Pf88jqDPSbSrLtXZg6Jc0RzOycFL0eoFhRB9cOAz+9A@mail.gmail.com
Whole thread Raw
List pgsql-hackers
As an initial attempt to try hands-on with postgresql, I've learned on user created functions and some other internals of postgresql. 

Few materials on postgresql indicate that the aggregate functions are slow due to some internal reasons (index covering, null etc). 

I'm looking forward to implement my own bit counting or counting mechanism (I've gone through some bit twiddling as well) via user defined functions (in C) and in cases I may need to create user defined data types as well.

Are there any possible scenarios where user defined count would perform better than the underlying implementation? Is it worth a try? 

And are there any better ways to evaluate, compare both? (other than EXPLAIN ANALYZIS)

Please guide. 

--
Regards,
K.Kanarupan
Undergraduate,
Dept. of Computer Science & Engineering
University of Moratuwa

Mobile:  +94 777 420 179

pgsql-hackers by date:

Previous
From: Daniel Farina
Date:
Subject: Re: Unpacking scalar JSON values
Next
From: Kanarupan Kularatnarajah
Date:
Subject: What is the algorithm used for counting the set bit (number of ones) of a bitmap/bitarray/betset in postgresql?