BareFeetWare-2 wrote:
> 
> Does IMDB allow use of their data this way? After my brief reading of
> their site, I thought they charge a $15k minimum per year for data.
> 
IMDb Pro offers additional information and services, all the information I
am grabbing is already available to the public and I am not publishing this
information, there are a lot of programs that do this.


BareFeetWare-2 wrote:
> 
>> The script is written in bash and I can give you the code but I think it
>> would be very complicated to adapt it to your schema.
> 
> Complicated? Why? In what format is the grabbed data (ie what tables,
> columns, rows)? It usually just takes an insert select to move data from
> one table's schema to another.
> 
Well, you would have to replace the insert commands, lets say that I have
table movies with columns id,title,year,plot
In the script I have to set the columns as variables:
id=tt12345
title="movie title"
year=2011
plot="this is the plot"

Ant then I call the command insert:
insert movies

The command insert knows the columns for each table, it goes column by
column, if the column is declared as a variable it is inserted so you would
have to replace all those commands with something like:
echo "INSERT INTO movies" etc...

Let me know if you are interested in the script, the script is included in 
https://launchpad.net/figuritas/+download the application , but I can post
and explain the relevant functions if you want.


BareFeetWare-2 wrote:
> 
> Well, yes, but it depends of the definition of "how many directors there
> are". The above counts how many directors there are in total, counting the
> same person for each movie they direct.
> 
> What you want, I think, however, is how many people there are who are
> directors (counting each person just once, even if they direct multiple
> movies), given by this:
> 
> select count(*) from "Capacity People Statistics"
> where Capacity_ID = (select ID from Capacity where Name = 'director')
> ;
> 
Ok then, yes I wanted to count directors counting each person just once, I
think that that code will not count much faster.


BareFeetWare-2 wrote:
> 
> Hopefully now that I've given you the query you actually needed, it now
> makes sense ;-)
> 
Yes it does, but then I don't need the Count column since I want to speed up
counting distinct directors but counting each person just once.


BareFeetWare-2 wrote:
> 
> No, I don't think you need more tables to achieve the above.
> 
Yes you can do it with the above but I want to make it very fast, with those
two additional tables I think it will be much faster.
-- 
View this message in context: 
http://old.nabble.com/Speed-up-count%28distinct-col%29-tp30864622p30935871.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to