Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6NEDpf74281 for ; Mon, 23 Jul 2001 10:13:51 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6L1VKa02396 for ; Fri, 20 Jul 2001 21:31:20 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f6L12s226139 for pgsql-sql@postgresql.org; Fri, 20 Jul 2001 21:02:54 -0400 (EDT) (envelope-from news) From: anssiman@my-deja.com (A. Mannisto) X-Newsgroups: comp.databases.postgresql.sql Subject: Searching multiple fields from multiple tables Date: 19 Jul 2001 01:57:37 -0700 Organization: http://groups.google.com/ Lines: 16 Message-ID: <8b9752ea.0107190057.5786f869@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-support@google.com To: pgsql-sql@postgresql.org X-Archive-Number: 200107/305 X-Sequence-Number: 4111 Hi, I should make search engine for psql environment. I works so that user sets search criterias (multiple words) and gets answers (like goooooogle does). Let say that I have one common key (primary) which is used as foreign key in rest of the tables. So I have many one_to_many relations. In this case what is the best way to implement SQL-query. Performance of the query is the most important thing. Should I use temporary table and collect the keys into it one by one whit INSERT INTO statements. Single SQL query will be quite complex and slow. After all, what kind of SQL-query philosophy is suitable?