Re: [PERFORM] nested query on last n rows of huge table

2006-02-28 Thread Michael Glaesemann
On Feb 24, 2006, at 23:13 , jcfischer wrote: Is there a way to limit the expensive query to only those last 1000 (or whatever) results? I have tried to nest SELECTS but my SQL-fu is to limited to get anything through the SQL processor :-) The basics of a subquery are: SELECT FROM (

Re: [PERFORM] nested query on last n rows of huge table

2006-02-28 Thread jcfischer
sorry: Postgres 8.0.2 server. The EXPLAIN ANALYZE for the query looks like this: explain analyze select syslog.logs.eventtime,assets.hosts.name,syslog.processes.name as process from syslog.logs,assets.hosts,assets.ipaddrs,assets.macaddrs,syslog.processes where msg like '%session opened for user ro