|From:||Michiel Meeuwissen <Michiel(dot)Meeuwissen(at)omroep(dot)nl>|
|To:||Rod Taylor <pg(at)rbt(dot)ca>|
|Subject:||Re: order by index, and inheritance|
|Views:||Raw Message | Whole Thread | Download mbox|
Rod Taylor <pg(at)rbt(dot)ca> wrote:
> The scan is picking the best method for grabbing everything within the
> table, since it is not aware that we do not require everything.
Hmm. That is a bit silly. Why does it use the index if select only from
> You can explicitly tell it what you want to do via:
> SELECT *
> FROM (SELECT * FROM mm_mediasources ORDER BY number DESC LIMIT 20
> UNION SELECT * FROM <subtable> ORDER BY number DESC LIMIT 20) AS tab
> ORDER BY number DESC LIMIT 20
I think you meant 'only mm_mediasources', and btw order by and limit are not
accepted before union, so the above query does not compile.
I can't figure out any acceptable work-around. Even if something as the
above would work, it still would be hardly elegant, and you can as well have
no support for inheritance (actually, you can _better_ have no inheritance,
because at least it is clear what works then).
btw. Why are these messages not appearing on the list itself?
Mediapark C101 Hilversum
+31 (0)35 6772979
nl_NL eo_XX en_US
|Next Message||Tom Lane||2004-04-22 12:36:28||Re: Wierd context-switching issue on Xeon patch for 7.4.1|
|Previous Message||Tom Lane||2004-04-22 05:13:47||Re: Wierd context-switching issue on Xeon patch for 7.4.1|