Re: Using wildcard for table name ? - Mailing list pgsql-novice

From David Johnston
Subject Re: Using wildcard for table name ?
Date
Msg-id 1374865039328-5765317.post@n5.nabble.com
Whole thread Raw
In response to Using wildcard for table name ?  (Francisco Leovey <fleovey@yahoo.com>)
Responses Re: Using wildcard for table name ?  (Francisco Leovey <fleovey@yahoo.com>)
List pgsql-novice
Francisco Leovey wrote
> I could join all tables into one to do the search but we want to keep data
> separated due to volume.

Pre-mature optimization is bad.

Partitioning is one solution while it has problems they are considerably
less-worse than what you are stuck with currently.

That said the answer to your specific question is NO.  Since you only
provided enough information to answer your specific question any advice that
may be offered is suspect since we know very little about your actual
situation.

I am curious how you deal with duplicate names and what you want returned in
that situation.  It may be worth having a master "name directory" table with
two columns.  The first column would be the person name and the second
column would be an array of table names in which that person name appears.
You would need triggers (or CRUD functions) to maintain consistency.  You
could then write a function that queries this table to find out which other
tables the name appears on and then you can create dynamic SQL queries for
just those tables.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Using-wildcard-for-table-name-tp5765314p5765317.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


pgsql-novice by date:

Previous
From: Daniel Staal
Date:
Subject: Re: Using wildcard for table name ?
Next
From: Francisco Leovey
Date:
Subject: Re: Using wildcard for table name ?