Tom Lane wrote:
> Fran Fabrizio <ffabrizio(at)exchange(dot)webmd(dot)net> writes:
> > However, with the new query, depending on the values of site_id and host_id,
> > execution time varies from .002 to 1.617 seconds!
>
> Does one site and/or host have many more table entries than the other?
I just tried clustering the table around that siteid_hostid_index and it did
reduce the number of blocks read from 15000 to 2200 for the query. However,
still running pretty slow (.9 second). I'm beginning to think I need something
more robust than a view. Perhaps I need to build an error_log table that gets
updated via trigger upon insert into log. We shall see.
Thanks,
Fran