Thread: Re: support for embedded db and a clustered index?

Re: support for embedded db and a clustered index?

From
"Julian Bui"
Date:
Hi all,

Does pgsql provide support for a clustered index?  By that I mean can I specify that the database insert records in the order of a particular attribute.  Many of my queries are time-range based and my row inserts are done chronologically, so it would benefit to have them sorted by when they were inserted.

Also, can pgsql be embedded in an application?  By that I mean it is easily deployable with an application.  The end user is unaware that a database even exists and the end user does not need to install pgsql.  I do NOT mean a db that runs on an embedded device (although I am hoping pgsql has a small memory footprint) and I also do NOT mean to ask if pgsql supports embedded sql.

Any help would be greatly appreciated. 

Thanks,
Julian

Re: support for embedded db and a clustered index?

From
"Scott Marlowe"
Date:
On Sat, Oct 25, 2008 at 12:02 PM, Julian Bui <julianbui@gmail.com> wrote:
> Hi all,
>
> Does pgsql provide support for a clustered index?  By that I mean can I
> specify that the database insert records in the order of a particular
> attribute.  Many of my queries are time-range based and my row inserts are
> done chronologically, so it would benefit to have them sorted by when they
> were inserted.

Sort of.  It supports static clustering.  Updates aren't clustered.

> Also, can pgsql be embedded in an application?  By that I mean it is easily
> deployable with an application.

Not really the same thing.  PostgreSQL is not embeddable in the
classic sense, and if you need an embedded database, look at SQLLite.

>  The end user is unaware that a database
> even exists and the end user does not need to install pgsql.

Yes, that's called a silent install.

> I do NOT mean
> a db that runs on an embedded device (although I am hoping pgsql has a small
> memory footprint) and I also do NOT mean to ask if pgsql supports embedded
> sql.

PostgreSQL is not optimized for small memory or disk footprint, it is
optimized for using more memory and being fast and reliable.  I think
you might want SQLLite for this job.

Re: support for embedded db and a clustered index?

From
Paul Bohme
Date:
Scott Marlowe wrote:
>
>> Also, can pgsql be embedded in an application?  By that I mean it is easily
>> deployable with an application.
>>
>
> Not really the same thing.  PostgreSQL is not embeddable in the
> classic sense, and if you need an embedded database, look at SQLLite.
>
>
...
>> I do NOT mean
>> a db that runs on an embedded device (although I am hoping pgsql has a small
>> memory footprint) and I also do NOT mean to ask if pgsql supports embedded
>> sql.
>>
>
> PostgreSQL is not optimized for small memory or disk footprint, it is
> optimized for using more memory and being fast and reliable.  I think
> you might want SQLLite for this job.
>

I would second the recommendation for SQLite.  Am using it extensively
in an embedded application with reasonably low constraints (32M of RAM
and flash) and have nothing but good to say about it.  (I find that its
C API kicks the tar out of Postgres' API, for usability/friendliness
btw. ;-)

Different tools for different jobs..

  -P

--
Paul Bohme | Chief Technologist
Brivo Systems LLC | 4330 East-West Highway Suite 250 Bethesda, MD 20814
Office: 301.664.5249 | Fax: 301.664.5264 | paul.bohme@brivo.com
Brivo's Official Website is: www.brivo.com