You could you use UNION to make this all execute in a single query.
On 5/10/06, Rhino <[EMAIL PROTECTED]> wrote:
Hi Chris, Joerg, and everyone else following this discussion,
Joerg, you are correct; the best way to sum the tables is individually and
then add the sums together with program logic
column:
> http://dev.mysql.com/doc/refman/5.0/en/alter-table.html
> Also note that as you add or delete rows the table does not stay in order.
>
> Hope this helps!
>
> Dan
>
>
> Adam Wolff wrote:
> > I have a very simple table that looks like this:
> > CREATE
I have a very simple table that looks like this:
CREATE TABLE `contacts` (
`id` int(11) NOT NULL auto_increment,
`fullname` varchar(100) default NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `user_id_2` (`user_id`,`fullname`),
CONSTRAINT `contacts_ibfk_1` FO
Well, I hadn't known about the spatial features of MySQL. If you're ok
using vendor extensions then that definitely looks like the way to go:
http://dev.mysql.com/doc/refman/5.0/en/gis-introduction.html
A
On Apr 24, Nick Hill wrote:
> Hello Adam
>
> Adam Wolff wrote:
> &
Actually I think this should be an INNER JOIN -- not a LEFT JOIN.
A
On Apr 23, Adam Wolff wrote:
> I didn't look through your code very carefully. Have you confirmed (using
> EXPLAIN) that your select query is using the index?
>
> I don't much about the mysql optimizer,
I didn't look through your code very carefully. Have you confirmed (using
EXPLAIN) that your select query is using the index?
I don't much about the mysql optimizer, but it's possible that this query:
> $query1="SELECT lat,lon from integer_test WHERE lat>$lat1 and lat<$lat2
> and lon>$lon1 and l
On Apr 22, Philippe Poelvoorde wrote:
> alter table s add index(login_name);
> alter table c add index(recordID);
To make this much faster, I think you may want:
alter table s add index(recordID, login_name);
alter table c add index(recordID);
Because after the join, the engine can use the
Hey! I figured out this one myself:
On Apr 19, Adam Wolff wrote:
> * Question 2:
> Why does introducing an extra WHERE clause make things slower?
> If I do this:
> SELECT * FROM contacts WHERE fullname LIKE "j%" AND user_id=1
> ORDER BY fullname LIMIT 10;
>
I have a table with a large number of rows. I have the primary key for a
record within the table. The record I'm looking for looks like this:
+++---+
| id | fullname | email |
+++
lly have 3! combinations of filters and sort
orders.
Adam
On Apr 20, Alexey Polyakov wrote:
> On 4/20/06, Adam Wolff <[EMAIL PROTECTED]> wrote:
>
> > How can I optimize the case where I filter on one key but sort on another?
> > This is fast:
> >SELECT * FROM co
Hi. I'm new to database optimization and I have a couple of questions.
I have a table like this:
+++-+-+
| id | fullname | email | user_id |
+++-+-+
Where fullname and email are varchar(100) a
11 matches
Mail list logo