I have my database segmented in 8 parts, where each part contains database with table user_data, for better search performance im using sphinx to index all those data but im come accross one problem … since table user_data dont have any unique field to represent each row but its a 1 to many table i have trouble to run my sphinx index correctly since it requires unique id and this way resolve in duplicate ids … any idea how can i workaround this? or generate unique id throught all sub indexes from different segments?
example:
SELECT user_id, item_id, info
FROM user_data
Which returns something like:
+----------+-----------------------+
| user_id | item_id | info |
+----------+-----------------------+
| 10 | 151 | asdf |
| 10 | 152 | test |
| 11 | 151 | 545 |
| 12 | 151 | sdfsd |
| 12 | 152 | eewwe |
| 12 | 153 | dfsd |
but i have to get
+----------+-----------------------------+
| user_id | item_id | info | id |
+----------+-----------------------------+
| 10 | 151 | asdf | 1 |
| 10 | 152 | test | 2 |
| 11 | 151 | 545 | 3 |
| 12 | 151 | sdfsd | 4 |
| 12 | 152 | eewwe | 5 |
| 12 | 153 | dfsd | 6 |
of course id must be unique throght all segments
first of all you should set before action query to set your variable
then use this variable to get fictional auto increment