Re: [Dbix-class] Static / reference data

2018-08-22 Thread Darren Duncan
On 2018-08-22 11:14 AM, Andy Armstrong wrote: I've got a database of TV and Radio programmes [1] which currently uses DBI and ad-hoc queries. I'm considering migrating it to use DBIC. What is your reason for considering the migration? Are you finding the DBI+SQL version hard to maintain? Le

Re: [Dbix-class] Static / reference data

2018-08-22 Thread Andy Armstrong
On 22 Aug 2018, at 21:10, Peter Mottram wrote: > > On 22/08/18 22:03, Andy Armstrong wrote: >> On 22 Aug 2018, at 20:55, Matthew Somerville wrote: >>> On 22 August 2018 at 20:22, Andy Armstrong wrote: If I do prefetch => ['service', { service => 'parent' }] I only get results for the

Re: [Dbix-class] Static / reference data

2018-08-22 Thread Peter Mottram
On 22/08/18 22:03, Andy Armstrong wrote: > On 22 Aug 2018, at 20:55, Matthew Somerville wrote: >> On 22 August 2018 at 20:22, Andy Armstrong wrote: >>> If I do prefetch => ['service', { service => 'parent' }] I only get results >>> for the cases where the service hierarchy is two levels deep.

Re: [Dbix-class] Static / reference data

2018-08-22 Thread Andy Armstrong
On 22 Aug 2018, at 20:55, Matthew Somerville wrote: > > On 22 August 2018 at 20:22, Andy Armstrong wrote: >> If I do prefetch => ['service', { service => 'parent' }] I only get results >> for the cases where the service hierarchy is two levels deep. > > I think you might only want prefetch =>

Re: [Dbix-class] Static / reference data

2018-08-22 Thread Matthew Somerville
On 22 August 2018 at 20:22, Andy Armstrong wrote: > If I do prefetch => ['service', { service => 'parent' }] I only get results > for the cases where the service hierarchy is two levels deep. I think you might only want prefetch => { service => 'parent' } ? The "The "prefetch" attribute can be u

Re: [Dbix-class] Static / reference data

2018-08-22 Thread Andy Armstrong
On 22 Aug 2018, at 19:50, Thomas Klausner wrote: > > Hi! > > On Wed, Aug 22, 2018 at 07:14:39PM +0100, Andy Armstrong wrote: > >> With DBIC every call to $prog->service->name results in a query >> against services - so for a page of 20 search results that's 20 >> additional queries. Even on a

Re: [Dbix-class] Static / reference data

2018-08-22 Thread Andy Armstrong
On 22 Aug 2018, at 19:39, Sam wrote: > This seems like a simple schema, not sure what caching would buy you unless > the DB is not a local service on the same box or network (or getting several > hundred requests per second). Yeah, it's definitely getting hundreds of requests a second :) > Gen

Re: [Dbix-class] Static / reference data

2018-08-22 Thread Thomas Klausner
Hi! On Wed, Aug 22, 2018 at 07:14:39PM +0100, Andy Armstrong wrote: > With DBIC every call to $prog->service->name results in a query > against services - so for a page of 20 search results that's 20 > additional queries. Even on a single page it's often the case that > many of those queries

Re: [Dbix-class] Static / reference data

2018-08-22 Thread Sam
On 08/22/2018 01:14 PM, Andy Armstrong wrote: Hello, I've got a database of TV and Radio programmes [1] which currently uses DBI and ad-hoc queries. I'm considering migrating it to use DBIC. The two most important tables are 'programmes' - which contains about 5.5 million TV and Radio program

[Dbix-class] Static / reference data

2018-08-22 Thread Andy Armstrong
Hello, I've got a database of TV and Radio programmes [1] which currently uses DBI and ad-hoc queries. I'm considering migrating it to use DBIC. The two most important tables are 'programmes' - which contains about 5.5 million TV and Radio programme listings and 'services' which lists 90 differ