On 8/23/2010 8:08 AM, Russell Keith-Magee wrote:
> On Mon, Aug 23, 2010 at 7:53 PM, Steve Holden wrote:
>> On 8/23/2010 7:48 AM, Russell Keith-Magee wrote:
>>> On Mon, Aug 23, 2010 at 7:32 PM, Andy wrote:
>> [...]
Also how random is random - would I get a uniform distribution of
records
On Mon, Aug 23, 2010 at 7:53 PM, Steve Holden wrote:
> On 8/23/2010 7:48 AM, Russell Keith-Magee wrote:
>> On Mon, Aug 23, 2010 at 7:32 PM, Andy wrote:
> [...]
>>> Also how random is random - would I get a uniform distribution of
>>> records among the shards?
>>
>> Depending on your level of math
On 8/23/2010 7:48 AM, Russell Keith-Magee wrote:
> On Mon, Aug 23, 2010 at 7:32 PM, Andy wrote:
[...]
>> Also how random is random - would I get a uniform distribution of
>> records among the shards?
>
> Depending on your level of mathematical rigor, that's not a simple
> question. To a simple ap
On Mon, Aug 23, 2010 at 7:32 PM, Andy wrote:
> On Aug 20, 10:04 pm, Russell Keith-Magee
> wrote:
>
>>Of course, given that you know your sharding scheme, you could use the
>>router directly.
>>
>>Tweet.objects.using(router.db_for_read(Tweet, author=a)).filter(author_id=a)
>
> Ah Thanks. This is w
On Aug 20, 10:04 pm, Russell Keith-Magee
wrote:
>Of course, given that you know your sharding scheme, you could use the
>router directly.
>
>Tweet.objects.using(router.db_for_read(Tweet, author=a)).filter(author_id=a)
Ah Thanks. This is what I need.
> You won't get any argument from me. What's
On Sat, Aug 21, 2010 at 8:09 AM, Andy wrote:
>
> So is there any way to write the database router to route the above
> query?
Other than explicitly naming the database -- not at present.
Of course, given that you know your sharding scheme, you could use the
router directly.
Tweet.objects.using
On Aug 19, 9:03 pm, Russell Keith-Magee
wrote:
> As for the instance not existing: Consider the following queries:
>
> MyModel.objects.filter(foo=bar)
>
> or
>
> MyModel.objects.update(foo=bar)
>
> These are read and write queries respectively, but neither has any
> meaningful concept of a curr
On Fri, Aug 20, 2010 at 9:57 AM, hcarvalhoalves
wrote:
> On 19 ago, 22:03, Russell Keith-Magee wrote:
>> The instance will exist, but the author_id won't. Unless you are
>> manually allocating the primary key, the primary key is allocated by
>> the database at the time of object save, which means
On 19 ago, 22:03, Russell Keith-Magee wrote:
> The instance will exist, but the author_id won't. Unless you are
> manually allocating the primary key, the primary key is allocated by
> the database at the time of object save, which means you won't be able
> to determine the primary key until *afte
On Fri, Aug 20, 2010 at 6:48 AM, Andy wrote:
>
>
> On Aug 19, 9:28 am, Russell Keith-Magee
> wrote:
>
>
>> You've got the right idea, but the implementation you provide probably
>> won't be comprehensive enough in practice. The hint is any extra
>> information that will help you determine the rig
On Aug 19, 9:28 am, Russell Keith-Magee
wrote:
> You've got the right idea, but the implementation you provide probably
> won't be comprehensive enough in practice. The hint is any extra
> information that will help you determine the right database to use;
> there's no guarantee that the insta
On Thu, Aug 19, 2010 at 7:06 PM, Andy wrote:
> I have a model Tweet that I'd like to shard horizontally based on the
> tweet author's id.
>
> class Tweet(models.Model):
> author_id = models.IntegreField()
> text = models.TextField()
>
>
> Let's say I set up 3 databases: shard0, shard1, shard
I have a model Tweet that I'd like to shard horizontally based on the
tweet author's id.
class Tweet(models.Model):
author_id = models.IntegreField()
text = models.TextField()
Let's say I set up 3 databases: shard0, shard1, shard2
I'd like to take the tweet author's id, do a modulo 3 an
13 matches
Mail list logo