[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Speeding up querys
At 01:28 PM 7/5/2002 +0300, you wrote:
>Members table:
>---------------------------
>| sku | member |
>---------------------------
>| vip | 1,4,6,14,25,46 |
>---------------------------
>
>Users table
>------------------------
>|sku | name | phone |
>------------------------
>| 1 | name1 | phone1 |
>------------------------
>| 2 | name2 | phone2 |
>------------------------
>| 3 | name3 | phone3 |
>------------------------
>
>
>
>I would be thankful if someone could give me some hints or advice.
Well, you qualified my post by saying "some" instead of "good". When I see
tables that have comma separated values in the fields, it usually causes me
to think that the tables could be re-designed. Perhaps something like:
---------------------------
| sku | member |
---------------------------
| 1 | 1 |
| 1 | 4 |
| 1 | 6 |
| 2 | 14 |
| 2 | 25 |
---------------------------
Once you have your data in a more performance-conducive format, you can
speed up your queries by indexing the fields which you use in WHERE
clauses. If you do end up going this way, there are some database mailing
lists out there that just help with SQL beginners, e.g.
<sql-general@yahoogroups.com>. HTH, HAND,
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Dan Browning, Kavod Technologies <db@kavod.com>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... and furthermore ... I don't like your trousers.