News for hackers. Stuff that matters.
Re:Redis in my Postgres by samstokes on Thursday October 18, 2012 @06:38PM (#4671438)
My guess unfortunately would be "probably not" - e.g. I can't think of a generic way to implement

    SELECT * from redis_db0 limit 5;
other than running the Redis command "KEYS *" - which does a linear scan of the entire Redis keyspace, locking Redis while it does so, and returning every single key in a potentially large streaming response - and truncating to the first 5. (That's fine if you have a few hundred keys, probably not if you have ten million.)

I'd love to be contradicted, though :)

Re:Redis in my Postgres by naww on Thursday October 18, 2012 @08:24PM (#4671726)
So you would need to write your own Foreign Data Wrapper and implement some mechanic to tell it if the SQL code is meant for first or the second interpreter?

Like: SELECT * FROM redis_db0 USING_REDIS limit 5; And Postgres would just pass that"USING_REDIS limit 5" through to Redis? Then Postgres would pass that table or array? back to caller.

Wait, wouldn't this also need modification for DB engine itself?

Re:Redis in my Postgres by malkia on Friday October 19, 2012 @01:06AM (#4672344)
Today was my first real usage of PostGres (moving one of our assetdb from sqlite to it, and although the update of the db is 5 time slower - well I haven't really done well there, the query later (which is more important) is from 1.5sec to 300msec on one recent example - about 100,000 assets for a video game).

I've also looked briefly about fdw, as a coworker of mine is trying out mongodb for our level editor... Looked at all implementation and read the every fdw code there (except oracle - as it seems most complex, but for good I guess - it checks the pgsql's AST (is that how it's called?) more deeply).

As for redis, maybe this line is relevant:

https://github.com/dpage/redis_fdw/blob/master/redis_fdw.c#L...

yes, for certain cases (I guess "select ") it does "keys ". I'm also trying out redis for our distributed caching in the studio.

So PostGres is my new favourite thing :) - the fdw looks easy to start, but probably hard to master it.

Re:Redis in my Postgres by deafbybeheading on Friday October 19, 2012 @02:10AM (#4672473)
> Today was my first real usage of PostGres

Then let us welcome you with some pedantry! Postgres or PostgreSQL, but never PostGres or--FSM forbid--PostGreSQL.

More seriously,

> fdw looks easy to start, but probably hard to master it.

Yep, like a number of Postgres features, such as user-defined types and user-defined aggregates. It's a great system, and not nearly as stuffy or hard to use as you may have heard.

Re:Redis in my Postgres by malkia on Friday October 19, 2012 @10:40AM (#4673694)
Ah, I will be careful how I write it :) Thanks!