Re: [PHP-DB] Trouble With Counting New Documents With Complex Query

2004-01-04 Thread Adam i Agnieszka Gasiorowski FNORD
Jeremy Peterson wrote: > I haven't tested this code, but it should get you started. I imagine that > you have a lot of different days that you are trying to restrict in your > query (This could be costing you a lot of time), so the first query removes > all articles you don't want up front befor

Re: [PHP-DB] Trouble With Counting New Documents With Complex Query

2004-01-02 Thread Adam i Agnieszka Gasiorowski FNORD
Jeremy Peterson wrote: > Could you repost your original message (I deleted it already, sorry.) and > more details about your database tables even some sample data. I'll try to > make more sense of the query you are performing and help you along. > > In general it would be better to eliminate t

Re: [PHP-DB] Trouble With Counting New Documents With Complex Query

2004-01-02 Thread Adam i Agnieszka Gasiorowski FNORD
Jeremy Peterson wrote: > If you are concerned with speed, consider multiple queries. Joins cause > most delays. Give that a shot. What do you mean? Sorry, please explain futher, I don't know what you have in mind... I have to do some of those joins, because of the relationships betw

Re: [PHP-DB] Trouble With Counting New Documents With Complex Query

2004-01-02 Thread Alan Langford
In all probability it's "(x_section.Status & 1) = 0" and "(x_instance.Status & 255) = 0" that's giving you the problem. Unfortunately this is a database schema problem not a query fix. By putting a computation on a field into the WHERE clause, you're forcing the database to do that computation