[SQL] constants in 2-column foreign keys or how to design a storage for text-groups ?

2009-12-08 Thread Andreas
Hi, my frontend has a lot of combo- and listboxes where one can chose a textsnippet that represents a key-number which is stored in several tables as foreign-key attributes. Those textsnippets are usually semantically grouped in 2-10 strings that belong together somehow. stupid example: -

Re: [SQL] Query Performance

2009-12-08 Thread Postgre Novice
Tomas: Thanks for your replay. I got it working within 3 minutes because of hash join by rearranging the query. explain analyze select *, subs from (select user_name,A.user_id, dnd_window_start, dnd_window_stop from users A ,subs_feed B where A.user_id=B.user_id and b.feed_id=1413 and f_sms='t